PluginProbe
GutSlider – All in One Slider and Carousel Blocks for Gutenberg / 1.0.0
GutSlider – All in One Slider and Carousel Blocks for Gutenberg v1.0.0
3.2.0 3.1.0 3.0.0 2.13.2 2.13.1 2.13.0 trunk 1.0.0 2.1.0 2.10.0 2.10.1 2.11.0 2.11.1 2.11.2 2.11.3 2.11.4 2.12.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.1 2.5.3 2.5.4 2.5.5 All 57 releases
slider-blocks / includes / Traits / Singleton.php

Singleton.php in GutSlider – All in One Slider and Carousel Blocks for Gutenberg 1.0.0, at includes/Traits/Singleton.php

23 lines 378 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Singleton Trait
4 */
5 namespace GutSliders\Traits;
6
7 // Exit if accessed directly.
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit;
10 }
11
12 trait Singleton {
13 /**
14 * Initialize the plugin
15 */
16 public static function init(){
17 static $instance = false;
18 if( ! $instance ) {
19 $instance = new self();
20 }
21 return $instance;
22 }
23 }