PluginProbe
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments / 1.2.0
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments v1.2.0
4.7.2 4.7.1 4.7.0 4.6.6 4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.1 4.5.0 4.4.2 4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.3 4.2.2 4.2.1 1.0.3 1.0.4 1.0.5 All 281 releases
← All changes | app/src/BlockLibrary/BlockPatternsService.php +5 -28 4.5.11.2.0 View file →
@@ -23,11 +23,14 @@
23 23 /**
24 24 * Set categories and patterns.
25 25 */
26 26 public function __construct() {
27 + $this->categories = [
28 + 'surecart_form' => [ 'label' => __( 'Checkout Form', 'surecart' ) ],
29 + ];
30 +
27 31 $this->patterns = [
28 32 'default',
29 - 'full-page',
30 33 'simple',
31 34 'sections',
32 35 'two-column',
33 36 'donation',
@@ -47,15 +50,9 @@
47 50 /**
48 51 * Register block patterns and
49 52 */
50 53 public function registerPatternsAndCategories() {
51 - $this->categories = [
52 - 'surecart_form' => [ 'label' => __( 'Checkout Form', 'surecart' ) ],
53 - 'surecart_shop' => [ 'label' => __( 'Shop', 'surecart' ) ],
54 - 'surecart_product_page' => [ 'label' => __( 'Product Page', 'surecart' ) ],
55 - 'surecart_related_products' => [ 'label' => __( 'Related Products', 'surecart' ) ],
56 - ];
57 - $this->registerCategories();
54 + // $this->registerCategories();
58 55 $this->registerPatterns();
59 56 }
60 57
61 58 /**
@@ -91,28 +88,8 @@
91 88 *
92 89 * @return void
93 90 */
94 91 public function registerPatterns() {
95 - // register the block patterns from patterns directory.
96 - $patterns = glob( plugin_dir_path( SURECART_PLUGIN_FILE ) . 'templates/patterns/*.php' );
97 -
98 - // sort by priority key.
99 - usort(
100 - $patterns,
101 - function ( $a, $b ) {
102 - $a = require $a;
103 - $b = require $b;
104 - return ( $a['priority'] ?? 0 ) <=> ( $b['priority'] ?? 0 );
105 - }
106 - );
107 -
108 - foreach ( $patterns as $pattern_file ) {
109 - register_block_pattern(
110 - 'surecart-' . basename( $pattern_file, '.php' ),
111 - require $pattern_file
112 - );
113 - }
114 -
115 92 /**
116 93 * Filters the plugin block patterns.
117 94 *
118 95 * @param array $patterns List of block patterns by name.