Skip to content

Commit

Permalink
[#39] pattern refactor to use plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-schmidt-viget committed Dec 19, 2023
1 parent 10373bd commit d34d4de
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
12 changes: 6 additions & 6 deletions client-mu-plugins/goodbids/src/classes/Frontend/Patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@ function (): void {
]
);

$sample_pattern = [
'name' => 'sample-pattern',
'path' => GOODBIDS_PLUGIN_PATH . 'views/patterns/sample-pattern.php',
'title' => __( 'GoodBids Sample Pattern', 'goodbids' ),
$auction_archive = [
'name' => 'template-archive-auction',
'path' => GOODBIDS_PLUGIN_PATH . 'views/patterns/template-archive-auction.php',
'title' => __( 'Archive Auction', 'goodbids' ),
'categories' => [ 'goodbids' ],
'keywords' => [ 'example', 'template', 'demo' ],
'keywords' => [ 'non-profit', 'starter', 'archive' ],
'inserter' => true,
];

$this->patterns = apply_filters(
'goodbids_block_patterns',
[
$sample_pattern,
$auction_archive,
]
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<?php
/**
* Pattern: Auction Archive
*
* @since 1.0.0
* @package GoodBids
*/
?>

<!-- wp:group {"tagName":"main","style":{"spacing":{"blockGap":"0","margin":{"top":"0"}}},"layout":{"type":"constrained","justifyContent":"left"}} -->
<main class="wp-block-group" style="margin-top:0">
<!-- wp:spacer -->
Expand Down
15 changes: 1 addition & 14 deletions themes/goodbids-nonprofit/inc/patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,7 @@ function ( array $patterns ): array {
'templateTypes' => [ 'front-page', 'home', 'page' ],
'source' => 'theme',
'inserter' => true,
],
[
'name' => 'template-archive-auction',
'file' => 'patterns/template-archive-auction.php',
'title' => __( 'Archive Auction', 'goodbids-nonprofit' ),
'description' => _x( 'Template for the Auction Archive', 'Block pattern description', 'goodbids-nonprofit' ),
'categories' => [ 'goodbids-np' ],
'keywords' => [ 'non-profit', 'starter', 'archive' ],
'blockTypes' => [ 'core/post-content' ],
'postTypes' => [ 'archive', 'wp_template' ],
'source' => 'theme',
],


]
];

return array_merge( $patterns, $theme_patterns );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!-- wp:template-part {"slug":"header","area":"header","tagName":"header"} /-->
<!-- wp:pattern {"slug":"goodbids-np/template-archive-auction"} /-->
<!-- wp:pattern {"slug":"goodbids/template-archive-auction"} /-->
<!-- wp:template-part {"slug":"footer","area":"footer","tagName":"footer"} /-->

0 comments on commit d34d4de

Please sign in to comment.