| 1 |
<?php |
| 2 |
/** |
| 3 |
* Block patterns registration. |
| 4 |
* |
| 5 |
* @package gutenberg |
| 6 |
*/ |
| 7 |
|
| 8 |
register_block_pattern_category( 'Query', array( 'label' => __( 'Query', 'gutenberg' ) ) ); |
| 9 |
|
| 10 |
// Initial Query block patterns. |
| 11 |
register_block_pattern( |
| 12 |
'query/large-posts', |
| 13 |
array( |
| 14 |
'title' => __( 'Large', 'gutenberg' ), |
| 15 |
'blockTypes' => array( 'core/query' ), |
| 16 |
'categories' => array( 'Query' ), |
| 17 |
'content' => '<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true}} --> |
| 18 |
<!-- wp:query-loop --> |
| 19 |
<!-- wp:post-title {"isLink":true} /--> |
| 20 |
<!-- wp:post-featured-image {"isLink":true,"align":"wide"} /--> |
| 21 |
<!-- wp:post-excerpt /--> |
| 22 |
<!-- wp:separator --> |
| 23 |
<hr class="wp-block-separator"/> |
| 24 |
<!-- /wp:separator --> |
| 25 |
<!-- wp:post-date /--> |
| 26 |
<!-- /wp:query-loop --> |
| 27 |
<!-- /wp:query -->', |
| 28 |
) |
| 29 |
); |
| 30 |
|
| 31 |
register_block_pattern( |
| 32 |
'query/medium-posts', |
| 33 |
array( |
| 34 |
'title' => __( 'Medium', 'gutenberg' ), |
| 35 |
'blockTypes' => array( 'core/query' ), |
| 36 |
'categories' => array( 'Query' ), |
| 37 |
'content' => '<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true}} --> |
| 38 |
<!-- wp:query-loop --> |
| 39 |
<!-- wp:columns {"align":"wide"} --> |
| 40 |
<div class="wp-block-columns alignwide"><!-- wp:column {"width":"66.66%"} --> |
| 41 |
<div class="wp-block-column" style="flex-basis:66.66%"><!-- wp:post-featured-image {"isLink":true} /--></div> |
| 42 |
<!-- /wp:column --> |
| 43 |
<!-- wp:column {"width":"33.33%"} --> |
| 44 |
<div class="wp-block-column" style="flex-basis:33.33%"><!-- wp:post-title {"isLink":true} /--> |
| 45 |
<!-- wp:post-excerpt /--></div> |
| 46 |
<!-- /wp:column --></div> |
| 47 |
<!-- /wp:columns --> |
| 48 |
<!-- /wp:query-loop --> |
| 49 |
<!-- /wp:query -->', |
| 50 |
) |
| 51 |
); |
| 52 |
|
| 53 |
register_block_pattern( |
| 54 |
'query/small-posts', |
| 55 |
array( |
| 56 |
'title' => __( 'Small', 'gutenberg' ), |
| 57 |
'blockTypes' => array( 'core/query' ), |
| 58 |
'categories' => array( 'Query' ), |
| 59 |
'content' => '<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true}} --> |
| 60 |
<!-- wp:query-loop --> |
| 61 |
<!-- wp:columns {"verticalAlignment":"center"} --> |
| 62 |
<div class="wp-block-columns are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center","width":"25%"} --> |
| 63 |
<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:25%"><!-- wp:post-featured-image {"isLink":true} /--></div> |
| 64 |
<!-- /wp:column --> |
| 65 |
<!-- wp:column {"verticalAlignment":"center","width":"75%"} --> |
| 66 |
<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:75%"><!-- wp:post-title {"isLink":true} /--></div> |
| 67 |
<!-- /wp:column --></div> |
| 68 |
<!-- /wp:columns --> |
| 69 |
<!-- /wp:query-loop --> |
| 70 |
<!-- /wp:query -->', |
| 71 |
) |
| 72 |
); |
| 73 |
|