PluginProbe
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress / 8.5.79
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress v8.5.79
9.1.3 9.1.2 9.1.1 9.1.0 9.0.3 9.0.2 9.0.1 9.0.0 8.5.79 8.5.78 8.5.77 8.5.76 8.5.75 8.5.74 8.5.73 8.5.72 8.5.71 8.5.70 8.5.69 8.5.68 8.5.35 8.5.36 8.5.37 8.5.38 8.5.39 All 222 releases
wpvr / includes / wpvr-divi-modules / wpvr_divi_modules.php

wpvr_divi_modules.php in WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress 8.5.79, at includes/wpvr-divi-modules/wpvr_divi_modules.php

79 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The file that defines the core plugin class
4 *
5 * A class definition that includes attributes and functions used across both the
6 * public-facing side of the site and the admin area.
7 *
8 * @link http://rextheme.com/
9 * @since 8.0.0
10 *
11 * @package Wpvr
12 * @subpackage Wpvr/includes
13 */
14
15 namespace WPVR\Builder\DIVI;
16
17 use WPVR\Builder\DIVI\Modules\WPVR_Modules;
18
19 /**
20 * Manages the singleton instance for DIVI modules integration and initialization.
21 *
22 * This class handles the setup and initialization of WPVR modules within the DIVI theme.
23 * It ensures a single instance of this class is created (singleton pattern).
24 *
25 * @since 8.4.8
26 */
27 class WPVR_Divi_modules { //phpcs:ignore
28
29 /**
30 * Holds the class instance.
31 *
32 * @var WPVR_Divi_modules|null The single instance of the class.
33 */
34 private static $_instance = null; //phpcs:ignore
35
36 /**
37 * Provides a single instance of this class.
38 *
39 * If the instance does not exist yet, it creates one and returns it. If it exists, it simply returns it.
40 * This method ensures that WPVR_Divi_modules can only have one instance.
41 *
42 * @return WPVR_Divi_modules Returns the single instance of this class.
43 */
44 public static function instance() {
45 if ( is_null( self::$_instance ) ) {
46 self::$_instance = new self();
47 }
48 return self::$_instance;
49 }
50
51 /**
52 * The class constructor.
53 *
54 * Private to prevent creating multiple instances directly.
55 */
56 private function __construct() {
57 $this->init();
58 }
59
60 /**
61 * The class constructor.
62 *
63 * Private to prevent creating multiple instances directly.
64 */
65 private function init() {
66 add_action( 'divi_extensions_init', array( $this, 'wpvr_initialize_extension' ) );
67 }
68
69 /**
70 * Initializes the DIVI module extension.
71 *
72 * Registers action hooks necessary for the extension setup, specifically
73 * initializing the DIVI extension when appropriate.
74 */
75 public function wpvr_initialize_extension() {
76 new WPVR_Modules();
77 }
78 }
79