method_block_theme_button_styles_label
apply_filters( 'method_block_theme_button_styles_label', string $label )
Filters the label text for the Theme Button secondary style selector dropdown (only shown when secondary styles have been passed via )method_block_theme_button_styles
Description
Customizes the label shown above the button styles SelectControl in the Theme Button block’s Inspector panel. Useful when the style options represent something other than generic “styles” (e.g., “Button Size”, “Button Variant”).
Parameters
$label (string) :
The label text. Default: 'Button Styles'.
Source
PHP
'buttonStylesLabel' => apply_filters( 'method_block_theme_button_styles_label', 'Button Styles' ),File: lib/blocks/method-buttons/method-buttons.php, function method_theme_button_enqueue_block_assets()
Usage
PHP
add_filter( 'method_block_theme_button_styles_label', function() {
return 'Button Size';
});Notes
- This label is only visible if
method_block_theme_button_stylesreturns a non‑false value. - The data is passed to the editor via
themeButtonData.buttonStylesLabel.
Related
method_block_theme_button_styles— Register button style options
Changelog
| Version | Description |
|---|---|
| 2.0.0 | Introduced. |