| 1 |
<?php |
| 2 |
/** |
| 3 |
* DIVI module Loader. |
| 4 |
* |
| 5 |
* This script checks if the base class 'ET_Builder_Element' exists to prevent errors. |
| 6 |
* and then dynamically loads PHP files for custom Divi modules from a specified directory. |
| 7 |
* |
| 8 |
* @package WPVR |
| 9 |
*/ |
| 10 |
|
| 11 |
namespace WPVR\Builder\DIVI\Modules; |
| 12 |
|
| 13 |
use DiviExtension; |
| 14 |
|
| 15 |
|
| 16 |
/** |
| 17 |
* WPVR_Modules class extends DiviExtension to implement custom modules for WPVR. |
| 18 |
* |
| 19 |
* This class handles the initialization and setup of WPVR modules within the Divi Builder |
| 20 |
* environment, providing custom functionalities specific to WPVR. |
| 21 |
* |
| 22 |
* @since 1.0.0 |
| 23 |
*/ |
| 24 |
class WPVR_Modules extends DiviExtension { |
| 25 |
|
| 26 |
/** |
| 27 |
* The gettext domain for the extension's translations. |
| 28 |
* This is used for internationalization and localization. |
| 29 |
* |
| 30 |
* @since 1.0.0 |
| 31 |
* @var string |
| 32 |
*/ |
| 33 |
public $gettext_domain = 'wpvr'; |
| 34 |
|
| 35 |
/** |
| 36 |
* The extension's WP Plugin name. |
| 37 |
* It is used internally to reference the plugin in various contexts. |
| 38 |
* |
| 39 |
* @since 1.0.0 |
| 40 |
* @var string |
| 41 |
*/ |
| 42 |
public $name = 'wpvr-divi-modules'; |
| 43 |
|
| 44 |
/** |
| 45 |
* The version of the extension. |
| 46 |
* This can be used to manage updates, compatibility checks, and more. |
| 47 |
* |
| 48 |
* @since 1.0.0 |
| 49 |
* @var string |
| 50 |
*/ |
| 51 |
public $version = '1.0.0'; |
| 52 |
|
| 53 |
/** |
| 54 |
* Constructor for WPVR_Modules. |
| 55 |
* Initializes the plugin's directory paths and sets up the necessary properties for the extension. |
| 56 |
* |
| 57 |
* @since 1.0.0 |
| 58 |
* @param string $name Optional. The name of the plugin. Default 'wpvr-divi-modules'. |
| 59 |
* @param array $args Optional. Additional arguments or configurations. |
| 60 |
*/ |
| 61 |
public function __construct( $name = 'wpvr-divi-modules', $args = array() ) { |
| 62 |
$this->plugin_dir = plugin_dir_path( __FILE__ ); |
| 63 |
$this->plugin_dir_url = plugin_dir_url( $this->plugin_dir ); |
| 64 |
parent::__construct( $name, $args ); |
| 65 |
} |
| 66 |
} |
| 67 |
|