From d34d4de53b357702fa5bf7479aef08541ba74841 Mon Sep 17 00:00:00 2001 From: Nathan Schmidt <91974372+nathan-schmidt-viget@users.noreply.github.com> Date: Tue, 19 Dec 2023 08:37:05 -0700 Subject: [PATCH] [#39] pattern refactor to use plugin --- .../goodbids/src/classes/Frontend/Patterns.php | 12 ++++++------ .../views}/patterns/template-archive-auction.php | 9 +++++++++ themes/goodbids-nonprofit/inc/patterns.php | 15 +-------------- .../templates/archive-gb-auction.html | 2 +- 4 files changed, 17 insertions(+), 21 deletions(-) rename {themes/goodbids-nonprofit => client-mu-plugins/goodbids/views}/patterns/template-archive-auction.php (97%) diff --git a/client-mu-plugins/goodbids/src/classes/Frontend/Patterns.php b/client-mu-plugins/goodbids/src/classes/Frontend/Patterns.php index 9fe2fe56b..2a3a3b1b8 100644 --- a/client-mu-plugins/goodbids/src/classes/Frontend/Patterns.php +++ b/client-mu-plugins/goodbids/src/classes/Frontend/Patterns.php @@ -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, ] ); diff --git a/themes/goodbids-nonprofit/patterns/template-archive-auction.php b/client-mu-plugins/goodbids/views/patterns/template-archive-auction.php similarity index 97% rename from themes/goodbids-nonprofit/patterns/template-archive-auction.php rename to client-mu-plugins/goodbids/views/patterns/template-archive-auction.php index 1f2f1b752..309f5c201 100644 --- a/themes/goodbids-nonprofit/patterns/template-archive-auction.php +++ b/client-mu-plugins/goodbids/views/patterns/template-archive-auction.php @@ -1,3 +1,12 @@ + +
diff --git a/themes/goodbids-nonprofit/inc/patterns.php b/themes/goodbids-nonprofit/inc/patterns.php index 578fd0602..f85f25882 100644 --- a/themes/goodbids-nonprofit/inc/patterns.php +++ b/themes/goodbids-nonprofit/inc/patterns.php @@ -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 ); diff --git a/themes/goodbids-nonprofit/templates/archive-gb-auction.html b/themes/goodbids-nonprofit/templates/archive-gb-auction.html index be285d457..4afcf8912 100644 --- a/themes/goodbids-nonprofit/templates/archive-gb-auction.html +++ b/themes/goodbids-nonprofit/templates/archive-gb-auction.html @@ -1,3 +1,3 @@ - +