diff --git a/lib/blocks.php b/lib/blocks.php index 571297ef..cbd3638a 100644 --- a/lib/blocks.php +++ b/lib/blocks.php @@ -32,4 +32,8 @@ 'grid', array( 'label' => __( 'Grid', 'ucsc' ) ) ); + register_block_pattern_category( + 'query_loop', + array( 'label' => __( 'Query Loop', 'ucsc' ) ) + ); } ); diff --git a/patterns/post-query-card.php b/patterns/post-query-card.php index a930a073..28e1792e 100644 --- a/patterns/post-query-card.php +++ b/patterns/post-query-card.php @@ -3,7 +3,7 @@ * Title: Query Loop Card * Slug: ucsc-2022/query-loop-card * Block Types: core/post-title, core/featured-image, core/post-date, core/post-excerpt - * Categories: text_layout + * Categories: text_layout query_loop */ ?> diff --git a/patterns/query-loop-grid.php b/patterns/query-loop-grid.php new file mode 100644 index 00000000..9b082ae9 --- /dev/null +++ b/patterns/query-loop-grid.php @@ -0,0 +1,25 @@ + + +
+ +
+ + + + + + + +
+ +
+ + diff --git a/src/scss/block-patterns/_cards.scss b/src/scss/block-patterns/_cards.scss index 763a979f..9108ddbe 100644 --- a/src/scss/block-patterns/_cards.scss +++ b/src/scss/block-patterns/_cards.scss @@ -104,3 +104,15 @@ } } } + +/* Hide placeholder in editor */ +.editor-styles-wrapper .ucsc__card--query-loop { + + &:not(&:has(figure)) { + + &::before { + content: ""; + display: none; + } + } +}