arguments
2 years ago
arrayable
2 years ago
filters
2 years ago
http
2 years ago
macro-constants
2 years ago
post
2 years ago
resources
2 years ago
theme
2 years ago
attributes-trait.php
2 years ago
base-attributes-trait.php
2 years ago
builder-helper.php
2 years ago
compatibility.php
2 years ago
date-tools.php
2 years ago
gallery.php
2 years ago
get-icon-trait.php
2 years ago
get-template-trait.php
2 years ago
html-attributes-trait.php
2 years ago
instance-trait.php
2 years ago
macros-parser.php
2 years ago
regexp-tools.php
2 years ago
tools.php
2 years ago
instance-trait.php
38 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Classes; |
| 5 | |
| 6 | // If this file is called directly, abort. |
| 7 | if ( ! defined( 'WPINC' ) ) { |
| 8 | die; |
| 9 | } |
| 10 | |
| 11 | trait Instance_Trait { |
| 12 | |
| 13 | public static $instance; |
| 14 | |
| 15 | /** |
| 16 | * Instance. |
| 17 | * |
| 18 | * Ensures only one instance of the plugin class is loaded or can be loaded. |
| 19 | * |
| 20 | * @return Instance_Trait An instance of the class. |
| 21 | * @since 1.0.0 |
| 22 | * @access public |
| 23 | * @static |
| 24 | */ |
| 25 | public static function instance() { |
| 26 | |
| 27 | if ( is_null( self::$instance ) ) { |
| 28 | self::$instance = new self(); |
| 29 | } |
| 30 | |
| 31 | return self::$instance; |
| 32 | } |
| 33 | |
| 34 | public static function clear() { |
| 35 | self::$instance = null; |
| 36 | } |
| 37 | } |
| 38 |