| @@ -1,33 +1,37 @@ | ||
| 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 | -} | |
| 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 | +} | |