PluginProbe
Ultimate FAQ Accordion Plugin / trunk
Ultimate FAQ Accordion Plugin vtrunk
2.4.14 2.4.13 2.4.12 2.4.11 2.4.10 2.3.1 2.3.2 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 All 241 releases
ultimate-faqs / includes / Patterns.class.php

Patterns.class.php in Ultimate FAQ Accordion Plugin trunk, at includes/Patterns.class.php

59 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) exit;
3
4 if ( ! class_exists( 'ewdufaqPatterns' ) ) {
5 /**
6 * Class to handle plugin Gutenberg blocks
7 *
8 * @since 2.1.16
9 */
10 class ewdufaqPatterns {
11
12 /**
13 * Add hooks
14 * @since 2.1.16
15 */
16 public function __construct() {
17
18 add_action( 'init', array( $this, 'ewd_ufaq_add_pattern_category' ) );
19 add_action( 'init', array( $this, 'ewd_ufaq_add_patterns' ) );
20 }
21
22 /**
23 * Register block patterns
24 * @since 2.1.16
25 */
26 public function ewd_ufaq_add_patterns() {
27
28 $block_patterns = array(
29 'faqs',
30 'featured-faqs',
31 'search',
32 'submit',
33 );
34
35 foreach ( $block_patterns as $block_pattern ) {
36 $pattern_file = EWD_UFAQ_PLUGIN_DIR . '/includes/patterns/' . $block_pattern . '.php';
37
38 register_block_pattern(
39 'ultimate-faqs/' . $block_pattern,
40 require $pattern_file
41 );
42 }
43 }
44
45 /**
46 * Create a new category of block patterns to hold our pattern(s)
47 * @since 2.1.16
48 */
49 public function ewd_ufaq_add_pattern_category() {
50
51 register_block_pattern_category(
52 'ewd-ufaq-block-patterns',
53 array(
54 'label' => __( 'Ultimate FAQs', 'ultimate-faqs' )
55 )
56 );
57 }
58 }
59 }