PluginProbe
WDesignKit – AI Templates, Widget Builder & MCP Workflow / 2.6.5
WDesignKit – AI Templates, Widget Builder & MCP Workflow v2.6.5
2.6.6 2.6.5 2.6.4 2.6.3 2.6.2 2.6.1 2.6.0 2.5.5 2.5.4 2.5.3 2.5.2 2.5.1 2.5.0 2.4.0 2.3.3 2.3.2 2.3.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 All 128 releases
wdesignkit / includes / widget-load / bricks / class-wdkit-bricks-files-load.php

class-wdkit-bricks-files-load.php in WDesignKit – AI Templates, Widget Builder & MCP Workflow 2.6.5, at includes/widget-load/bricks/class-wdkit-bricks-files-load.php

85 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Exit if accessed directly.
4 *
5 * @link https://posimyth.com/
6 * @since 1.0.1
7 *
8 * @package Wdesignkit
9 * @subpackage Wdesignkit/includes/bricks
10 * */
11
12 /**
13 * Exit if accessed directly.
14 */
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19 if ( ! class_exists( 'Wdkit_Bricks_Files_Load' ) ) {
20
21 /**
22 * This class used for only bricks widget load
23 *
24 * @since 1.0.1
25 */
26 class Wdkit_Bricks_Files_Load {
27
28 /**
29 * Instance
30 *
31 * @since 1.0.1
32 * @var \Bricks\Plugin The single instance of the class.
33 */
34 private static $instance = null;
35
36 /**
37 * Instance
38 *
39 * Ensures only one instance of the class is loaded or can be loaded.
40 *
41 * @since 1.0.1
42 * @return \Bricks\Plugin An instance of the class.
43 */
44 public static function instance() {
45 if ( is_null( self::$instance ) ) {
46 self::$instance = new self();
47 }
48 return self::$instance;
49 }
50
51 /**
52 * Perform some compatibility checks to make sure basic requirements are meet.
53 *
54 * @since 1.0.1
55 */
56 public function __construct() {
57 add_action( 'init', array( $this, 'wdkit_init' ), 99 );
58 }
59
60 /**
61 * Initialize
62 *
63 * Load the addons functionality only after bricks is initialized.
64 *
65 * Fired by `bricks/init` action hook.
66 *
67 * @since 1.0.1
68 */
69 public function wdkit_init() {
70 if ( ! defined( 'WDKIT_BUILDER_PATH' ) || ! function_exists( 'wdesignkit_get_widget_registry' ) || ! class_exists( 'Bricks\Elements' ) ) {
71 return false;
72 }
73
74 foreach ( wdesignkit_get_widget_registry( 'bricks' ) as $entry ) {
75 if ( file_exists( $entry['file'] ) ) {
76 Bricks\Elements::register_element( $entry['file'] );
77 }
78 }
79 }
80
81 }
82
83 Wdkit_Bricks_Files_Load::instance();
84 }
85