| 1 |
<?php |
| 2 |
namespace Elementor\Modules\Library; |
| 3 |
|
| 4 |
use Elementor\Core\Base\Module as BaseModule; |
| 5 |
use Elementor\Modules\AtomicWidgets\Module as AtomicWidgets_Module; |
| 6 |
use Elementor\Plugin; |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly. |
| 10 |
} |
| 11 |
|
| 12 |
/** |
| 13 |
* Elementor library module. |
| 14 |
* |
| 15 |
* Elementor library module handler class is responsible for registering and |
| 16 |
* managing Elementor library modules. |
| 17 |
* |
| 18 |
* @since 2.0.0 |
| 19 |
*/ |
| 20 |
class Module extends BaseModule { |
| 21 |
|
| 22 |
/** |
| 23 |
* Get module name. |
| 24 |
* |
| 25 |
* Retrieve the library module name. |
| 26 |
* |
| 27 |
* @since 2.0.0 |
| 28 |
* @access public |
| 29 |
* |
| 30 |
* @return string Module name. |
| 31 |
*/ |
| 32 |
public function get_name() { |
| 33 |
return 'library'; |
| 34 |
} |
| 35 |
|
| 36 |
/** |
| 37 |
* Library module constructor. |
| 38 |
* |
| 39 |
* Initializing Elementor library module. |
| 40 |
* |
| 41 |
* @since 2.0.0 |
| 42 |
* @access public |
| 43 |
*/ |
| 44 |
public function __construct() { |
| 45 |
add_action( 'elementor/documents/register', [ $this, 'register_documents' ] ); |
| 46 |
} |
| 47 |
|
| 48 |
public function register_documents() { |
| 49 |
Plugin::$instance->documents |
| 50 |
->register_document_type( 'not-supported', Documents\Not_Supported::get_class_full_name() ) |
| 51 |
->register_document_type( 'page', Documents\Page::get_class_full_name() ) |
| 52 |
->register_document_type( 'section', Documents\Section::get_class_full_name() ); |
| 53 |
|
| 54 |
$experiments_manager = Plugin::$instance->experiments; |
| 55 |
|
| 56 |
if ( $experiments_manager->is_feature_active( 'container' ) ) { |
| 57 |
Plugin::$instance->documents |
| 58 |
->register_document_type( 'container', Documents\Container::get_class_full_name() ); |
| 59 |
} |
| 60 |
} |
| 61 |
} |
| 62 |
|