PluginProbe
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.4
JetFormBuilder — Dynamic Blocks Form Builder v3.6.4
3.6.5.2 3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 All 130 releases
jetformbuilder / components / module / base-module-static-instance-trait.php
base-module-static-instance-trait.php
35 lines 739 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3
4 namespace JFB_Components\Module;
5
6 // If this file is called directly, abort.
7 use Jet_Form_Builder\Exceptions\Repository_Exception;
8
9 if ( ! defined( 'WPINC' ) ) {
10 die;
11 }
12
13 trait Base_Module_Static_Instance_Trait {
14
15 /**
16 * @return Base_Module_After_Install_It|Base_Module_Dir_It|Base_Module_Handle_It|Base_Module_It|Base_Module_Url_It|Mock_Module
17 */
18 public static function instance() {
19 if ( ! jet_form_builder()->has_module( static::get_instance_id() ) ) {
20 return new Mock_Module();
21 }
22
23 try {
24 return jet_form_builder()->module( static::get_instance_id() );
25 } catch ( Repository_Exception $exception ) {
26 return new Mock_Module();
27 }
28 }
29
30 public function rep_item_id() {
31 return static::get_instance_id();
32 }
33
34 }
35