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

Remote: reassigned block patterns to default categories #5664

Merged
merged 4 commits into from
Mar 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion remote/inc/block-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@
* @return void
*/
function remote_register_block_patterns() {

//Needed until https://github.com/WordPress/gutenberg/issues/39500 is fixed.
$block_pattern_categories = array(
'pages' => array( 'label' => __( 'Pages', 'remote' ) ),
'featured' => array( 'label' => __( 'Featured', 'remote' ) ),
'columns' => array( 'label' => __( 'Columns', 'remote' ) ),
'text' => array( 'label' => __( 'Text', 'remote' ) ),
'query' => array( 'label' => __( 'Query', 'remote' ) ),
);

/**
Expand Down
2 changes: 1 addition & 1 deletion remote/inc/patterns/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
return array(
'title' => __( 'Categories', 'remote' ),
'categories' => array( 'text' ),
'categories' => array( 'text', 'featured' ),
'content' => '<!-- wp:paragraph {"style":{"typography":{"textTransform":"uppercase"}},"fontSize":"small"} -->
<p class="has-small-font-size" style="text-transform:uppercase">' . esc_html__( 'Categories', 'remote' ) . '</p>
<!-- /wp:paragraph -->
Expand Down
2 changes: 1 addition & 1 deletion remote/inc/patterns/hero-text.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
return array(
'title' => __( 'Hero text', 'remote' ),
'categories' => array( 'pages' ),
'categories' => array( 'text', 'featured' ),
'content' => '<!-- wp:group {"align":"wide"} -->
<div class="wp-block-group alignwide"><!-- wp:spacer {"height":"32px"} -->
<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
Expand Down
7 changes: 3 additions & 4 deletions remote/inc/patterns/hidden-search-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
* Search form
*/
return array(
'title' => __( 'Search form', 'remote' ),
'categories' => array( 'pages' ),
'inserter' => false,
'content' => '<!-- wp:group {"layout":{"inherit":true}} -->
'title' => __( 'Search form', 'remote' ),
'inserter' => false,
'content' => '<!-- wp:group {"layout":{"inherit":true}} -->
<div class="wp-block-group"><!-- wp:spacer {"height":"32px"} -->
<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
Expand Down
2 changes: 1 addition & 1 deletion remote/inc/patterns/image-with-text.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
return array(
'title' => __( 'Image with text', 'remote' ),
'categories' => array( 'text', 'columns' ),
'categories' => array( 'text', 'columns', 'featured' ),
'content' => '<!-- wp:image {"align":"wide","sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image alignwide size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/laptop.jpg" alt="' . esc_attr__( 'Picture of a laptop', 'remote' ) . '"/></figure>
<!-- /wp:image -->
Expand Down
2 changes: 1 addition & 1 deletion remote/inc/patterns/posts-grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

return array(
'title' => __( 'Posts grid', 'remote' ),
'categories' => array( 'query' ),
'categories' => array( 'query', 'featured' ),
'blockTypes' => array( 'core/query' ),
'content' => '<!-- wp:group {"align":"full","layout":{"inherit":true}} -->
<div class="wp-block-group alignfull"><!-- wp:query {"queryId":0,"query":{"perPage":6,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true,"taxQuery":null},"tagName":"main","displayLayout":{"type":"flex","columns":2},"align":"wide"} -->
Expand Down
2 changes: 1 addition & 1 deletion remote/inc/patterns/posts-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
return array(
'title' => __( 'Posts list', 'remote' ),
'categories' => array( 'pages' ),
'categories' => array( 'query', 'featured' ),
'content' => '<!-- wp:group {"align":"full","layout":{"inherit":true}} -->
<div class="wp-block-group alignfull"><!-- wp:query {"queryId":0,"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true,"taxQuery":null},"tagName":"main","align":"wide"} -->
<main class="wp-block-query alignwide"><!-- wp:post-template -->
Expand Down
2 changes: 1 addition & 1 deletion remote/inc/patterns/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
return array(
'title' => __( 'Tags', 'remote' ),
'categories' => array( 'text' ),
'categories' => array( 'text', 'featured' ),
'content' => '<!-- wp:paragraph {"style":{"typography":{"textTransform":"uppercase"}},"fontSize":"small"} -->
<p class="has-small-font-size" style="text-transform:uppercase">' . esc_html__( 'Tags', 'remote' ) . '</p>
<!-- /wp:paragraph -->
Expand Down