Diff: STRATO-apps/wordpress_03/app/wp-content/themes/blocksy/inc/components/patterns.php

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php
2 +
3 + namespace Blocksy;
4 +
5 + class ThemePatterns {
6 + private $patterns = [
7 + 'pattern-1',
8 + 'pattern-2',
9 + 'pattern-3',
10 + 'pattern-4',
11 + 'pattern-5',
12 + 'pattern-6',
13 + 'pattern-7',
14 + 'pattern-8',
15 + 'pattern-9',
16 + 'pattern-10',
17 + 'pattern-11',
18 + 'pattern-12',
19 + ];
20 +
21 + public function __construct() {
22 + add_action('init', [$this, 'register_patterns']);
23 + }
24 +
25 + public function register_patterns() {
26 + if (! function_exists('register_block_pattern')) {
27 + return;
28 + }
29 +
30 + register_block_pattern_category('blocksy', [
31 + 'label' => _x('Blocksy', 'Block pattern category', 'blocksy'),
32 + 'description' => __('Patterns that contain buttons and call to actions.', 'blocksy'),
33 + ]);
34 +
35 + foreach ($this->patterns as $pattern) {
36 + register_block_pattern(
37 + 'blocksy/' . $pattern,
38 + require __DIR__ . '/patterns/' . $pattern . '.php'
39 + );
40 + }
41 + }
42 + }
43 +