Skip to content

Commit acc6d61

Browse files
committed
Merge branch 'develop' into feature/95-latest-posts-pattern
2 parents faf1964 + f92d253 commit acc6d61

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/**
3+
* Copyright 2021 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
* @package MaterialDesign
18+
*/
19+
20+
/**
21+
* Hero section + image pattern.
22+
*
23+
* @package MaterialDesign
24+
*/
25+
26+
use function MaterialDesign\Plugin\get_plugin_instance;
27+
28+
$image = esc_url( get_plugin_instance()->asset_url( 'assets/images/placeholder.png' ) );
29+
30+
return [
31+
'title' => __( 'Hero section + Image', 'material-design' ),
32+
'content' => "<!-- wp:group {\"align\":\"wide\"} --><div class=\"wp-block-group alignwide\"><div class=\"wp-block-group__inner-container\"><!-- wp:columns {\"verticalAlignment\":\"center\",\"align\":\"wide\"} --><div class=\"wp-block-columns alignwide are-vertically-aligned-center\"><!-- wp:column {\"verticalAlignment\":\"center\"} --><div class=\"wp-block-column is-vertically-aligned-center\"><!-- wp:heading --><h2>Landing Page Hero Section</h2><!-- /wp:heading --><!-- wp:paragraph --><p>Imperdiet taciti nostra pulvinar bibendum congue varius sapien, diam curae pellentesque quam auctor praesent nullam convallis, tincidunt urna suscipit litora netus dictum.</p><!-- /wp:paragraph --><!-- wp:material/buttons --><div class=\"wp-block-material-buttons\"><!-- wp:material/button {\"iconPosition\":\"none\"} --><div class=\"wp-block-material-button\" id=\"block-material-button-51\"><button class=\"mdc-button mdc-button--raised\"><div class=\"mdc-button__ripple\"></div><span class=\"mdc-button__label\">Get Started</span></button></div><!-- /wp:material/button --></div><!-- /wp:material/buttons --></div><!-- /wp:column --><!-- wp:column {\"verticalAlignment\":\"center\"} --><div class=\"wp-block-column is-vertically-aligned-center\"><!-- wp:image {\"align\":\"full\",\"id\":127,\"sizeSlug\":\"medium\",\"linkDestination\":\"none\"} --><figure class=\"wp-block-image alignfull size-medium\"><img src=\"$image\" alt=\"\" class=\"wp-image-127\"/></figure><!-- /wp:image --></div><!-- /wp:column --></div><!-- /wp:columns --></div></div><!-- /wp:group -->",
33+
'viewportWidth' => 800,
34+
'categories' => [ 'material', 'buttons', 'header', 'image' ],
35+
'description' => __( 'Hero section with image', 'material-design' ),
36+
];

plugin/php/class-block-patterns.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public function register() {
8585
'single-feature-extended',
8686
'hero-section',
8787
'pricing',
88+
'hero-section-image',
8889
'latest-posts',
8990
];
9091

plugin/tests/phpunit/php/class-test-block-patterns.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class Test_Block_Patterns extends \WP_UnitTestCase {
5050
'single-feature-extended',
5151
'hero-section',
5252
'pricing',
53+
'hero-section-image',
5354
'latest-posts',
5455
];
5556

0 commit comments

Comments
 (0)