-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pattern: Experiment with using template slots for content replacement
- Loading branch information
Showing
3 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
/** | ||
* Temporary compatibility shims for pattern APIs present in Gutenberg. | ||
* | ||
* @package gutenberg | ||
*/ | ||
|
||
register_block_pattern( | ||
'gutenberg/get-in-touch', | ||
array( | ||
'title' => esc_html__( 'Get In Touch', 'default' ), | ||
'categories' => array( 'call-to-action' ), | ||
'content' => implode( | ||
'', | ||
array( | ||
'<!-- wp:paragraph {"fontSize":"huge"} -->', | ||
'<p class="has-huge-font-size"></$wp:template-slot name="getInTouch"></p>', | ||
'<!-- /wp:paragraph -->', | ||
'<!-- wp:columns -->', | ||
'<div class="wp-block-columns"><!-- wp:column -->', | ||
'<div class="wp-block-column"><!-- wp:paragraph -->', | ||
'<p>' . esc_html__( '20 Cooper Avenue', 'default' ) . '<br>' . esc_html__( 'New York, New York 10023', 'default' ) . '</p>', | ||
'<!-- /wp:paragraph --></div>', | ||
'<!-- /wp:column -->', | ||
'<!-- wp:column -->', | ||
'<div class="wp-block-column"><!-- wp:paragraph -->', | ||
'<p>' . esc_html__( '(555) 555-5555', 'default' ) . '<br><a href="mailto:example@example.com">' . esc_html__( 'example@example.com', 'default' ) . '</a></p>', | ||
'<!-- /wp:paragraph --></div>', | ||
'<!-- /wp:column --></div>', | ||
'<!-- /wp:columns -->', | ||
'<!-- wp:buttons -->', | ||
'<div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"dark-gray"} -->', | ||
'<div class="wp-block-button"><a class="wp-block-button__link has-dark-gray-background-color has-background">' . esc_html__( 'Contact Us', 'default' ) . '</a></div>', | ||
'<!-- /wp:button --></div>', | ||
'<!-- /wp:buttons -->', | ||
'<!-- wp:template-fill {"name":"getInTouch"} -->', | ||
esc_html__( 'Get In Touch', 'default' ), | ||
'<!-- /wp:template-fill -->', | ||
) | ||
), | ||
) | ||
); |
This file contains 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
This file contains 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