Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Hero and two columns" pattern #21130

Merged
merged 12 commits into from
May 12, 2020
2 changes: 2 additions & 0 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ function gutenberg_extend_settings_custom_units( $settings ) {
/*
* Register default patterns if not registered in Core already.
*/

if ( class_exists( 'WP_Block_Patterns_Registry' ) && ! WP_Block_Patterns_Registry::get_instance()->is_registered( 'text-two-columns' ) ) {
register_block_pattern( 'core/text-two-columns', gutenberg_load_block_pattern( 'text-two-columns' ) );
register_block_pattern( 'core/two-buttons', gutenberg_load_block_pattern( 'two-buttons' ) );
Expand All @@ -691,5 +692,6 @@ function gutenberg_extend_settings_custom_units( $settings ) {
register_block_pattern( 'core/hero-two-columns', gutenberg_load_block_pattern( 'hero-two-columns' ) );
register_block_pattern( 'core/numbered-features', gutenberg_load_block_pattern( 'numbered-features' ) );
register_block_pattern( 'core/its-time', gutenberg_load_block_pattern( 'its-time' ) );
register_block_pattern( 'core/hero-right-column', gutenberg_load_block_pattern( 'hero-right-column' ) );
register_block_pattern( 'core/testimonials', gutenberg_load_block_pattern( 'testimonials' ) );
}
11 changes: 11 additions & 0 deletions lib/patterns/hero-right-column.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/**
* Hero Right Column block pattern.
*
* @package gutenberg
*/

return array(
'title' => __( 'Hero Right Column', 'gutenberg' ),
'content' => "<!-- wp:group {\"align\":\"wide\"} -->\n<div class=\"wp-block-group alignwide\"><div class=\"wp-block-group__inner-container\"><!-- wp:group {\"align\":\"wide\"} -->\n<div class=\"wp-block-group alignwide\"><div class=\"wp-block-group__inner-container\"><!-- wp:cover {\"gradient\":\"blush-light-purple\",\"align\":\"wide\"} -->\n<div class=\"wp-block-cover alignwide has-background-dim has-background-gradient has-blush-light-purple-gradient-background\"><div class=\"wp-block-cover__inner-container\"><!-- wp:paragraph {\"align\":\"center\",\"placeholder\":\"Write title…\",\"style\":{\"color\":{\"text\":\"#13394a\"},\"typography\":{\"fontSize\":60}}} -->\n<p class=\"has-text-align-center has-text-color\" style=\"font-size:60px;color:#13394a\"><strong>Easy &amp; Accessible</strong></p>\n<!-- /wp:paragraph --></div></div>\n<!-- /wp:cover --></div></div>\n<!-- /wp:group -->\n\n<!-- wp:columns {\"align\":\"full\"} -->\n<div class=\"wp-block-columns alignfull\"><!-- wp:column -->\n<div class=\"wp-block-column\"></div>\n<!-- /wp:column -->\n\n<!-- wp:column -->\n<div class=\"wp-block-column\"><!-- wp:spacer {\"height\":30} -->\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"></div>\n<!-- /wp:spacer -->\n\n<!-- wp:paragraph -->\n<p>Extend it with over 54,000 plugins to help your website meet your needs. Hundreds of thousands of developers and site owners trust it worldwide. Add an online store, galleries, mailing lists, forums, analytics, and much more. </p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>Hundreds of thousands of developers and site owners trust it worldwide. Add an online store, galleries, mailing lists, forums, analytics, and much more.</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:spacer {\"height\":20} -->\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"></div>\n<!-- /wp:spacer -->\n\n<!-- wp:buttons -->\n<div class=\"wp-block-buttons\"><!-- wp:button {\"borderRadius\":50,\"style\":{\"color\":{\"text\":\"#ffffff\",\"background\":\"#13394a\"}},\"className\":\"is-style-fill\"} -->\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link has-text-color has-background\" style=\"border-radius:50px;background-color:#13394a;color:#ffffff\">Learn more</a></div>\n<!-- /wp:button --></div>\n<!-- /wp:buttons --></div>\n<!-- /wp:column --></div>\n<!-- /wp:columns --></div></div>\n<!-- /wp:group -->",
);