Created
April 3, 2023 15:55
-
-
Save ibrahim-kardi/dda7b553ce303e4b246735fe9b2d2026 to your computer and use it in GitHub Desktop.
regsiter pattern in the block theme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
register_block_pattern( | |
'starter/custom-button-pattern', | |
array( | |
'title' => __( 'Custom buttons', 'starter' ), | |
'description' => _x( 'Two horizontal buttons, the left button is filled in, and the right button is outlined.', 'Block pattern description', 'starter' ), | |
'categories' => array( 'buttons' ), | |
'content' => '<!-- wp:buttons --> | |
<div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"vivid-green-cyan"} --> | |
<div class="wp-block-button"><a class="wp-block-button__link has-vivid-green-cyan-background-color has-background wp-element-button">Custom button</a></div> | |
<!-- /wp:button --></div> | |
<!-- /wp:buttons -->', | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment