Button


Prompt visitors to take action with a button-style link.

  • Name: core/button
  • Category: design
  • API Version: 3
  • Block Type: Hybrid (static save + server enhancements)
  • Keywords: link

Block Relationships

Parent blocks (direct):
core/buttons

Attributes

Defined via the attributes property in block.json.

Attribute Type Default Description
tagName string "a" Enum: a, button
type string "button"
url string Source: attribute. Selector: a. HTML attr: href. Role: content
title string Source: attribute. Selector: a,button. HTML attr: title. Role: content
text rich-text Source: rich-text. Selector: a,button. Role: content
linkTarget string Source: attribute. Selector: a. HTML attr: target. Role: content
rel string Source: attribute. Selector: a. HTML attr: rel. Role: content
placeholder string
backgroundColor string
textColor string
gradient string

Supports

Defined via the supports property in block.json.

Block Styles

Defined via the styles property in block.json.

Style Name Label Default
fill Fill Yes
outline Outline No

CSS Selectors

Defined via the selectors property in block.json.

  • root: .wp-block-button .wp-block-button__link
  • typography:
    • writingMode: .wp-block-button
  • dimensions:
    • root: .wp-block-button
    • width: .wp-block-button

Block Markup

This is a hybrid block. It saves static markup that the server may enhance during rendering.

<!-- wp:button {"tagName":"a","type":"button"} -->
<!-- Content... -->
<!-- /wp:button -->

Source