attributes-trait.php
5 years ago
condition-helper.php
5 years ago
curl-helper.php
5 years ago
factory.php
5 years ago
gallery.php
5 years ago
get-icon-trait.php
5 years ago
get-template-trait.php
5 years ago
instance-trait.php
5 years ago
listing-filter-manager.php
5 years ago
listing-filter.php
5 years ago
messages-helper-trait.php
5 years ago
tools.php
5 years ago
instance-trait.php
33 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Classes; |
| 5 | |
| 6 | |
| 7 | trait Instance_Trait { |
| 8 | |
| 9 | public static $instance; |
| 10 | |
| 11 | /** |
| 12 | * Instance. |
| 13 | * |
| 14 | * Ensures only one instance of the plugin class is loaded or can be loaded. |
| 15 | * |
| 16 | * @return Instance_Trait An instance of the class. |
| 17 | * @since 1.0.0 |
| 18 | * @access public |
| 19 | * @static |
| 20 | */ |
| 21 | public static function instance() { |
| 22 | |
| 23 | if ( is_null( self::$instance ) ) { |
| 24 | self::$instance = new self(); |
| 25 | } |
| 26 | |
| 27 | return self::$instance; |
| 28 | } |
| 29 | |
| 30 | public static function clear() { |
| 31 | self::$instance = null; |
| 32 | } |
| 33 | } |