| 1 |
<?php |
| 2 |
namespace Elementor\Modules\NestedElements; |
| 3 |
|
| 4 |
use Elementor\Core\Experiments\Manager as Experiments_Manager; |
| 5 |
|
| 6 |
if ( ! defined( 'ABSPATH' ) ) { |
| 7 |
exit; // Exit if accessed directly. |
| 8 |
} |
| 9 |
|
| 10 |
class Module extends \Elementor\Core\Base\Module { |
| 11 |
|
| 12 |
const EXPERIMENT_NAME = 'nested-elements'; |
| 13 |
|
| 14 |
public static function get_experimental_data() { |
| 15 |
return [ |
| 16 |
'name' => self::EXPERIMENT_NAME, |
| 17 |
'title' => esc_html__( 'Nested Elements', 'elementor' ), |
| 18 |
'description' => sprintf( |
| 19 |
'%1$s <a href="https://go.elementor.com/wp-dash-nested-elements/" target="_blank">%2$s</a>', |
| 20 |
esc_html__( 'Create a rich user experience by layering widgets together inside "Nested" Tabs, etc. When turned on, we’ll automatically enable new nested features. Your old widgets won’t be affected.', 'elementor' ), |
| 21 |
esc_html__( 'Learn more', 'elementor' ) |
| 22 |
), |
| 23 |
'release_status' => Experiments_Manager::RELEASE_STATUS_STABLE, |
| 24 |
'default' => Experiments_Manager::STATE_ACTIVE, |
| 25 |
'dependencies' => [ |
| 26 |
'container', |
| 27 |
], |
| 28 |
]; |
| 29 |
} |
| 30 |
|
| 31 |
public function get_name() { |
| 32 |
return 'nested-elements'; |
| 33 |
} |
| 34 |
|
| 35 |
public function __construct() { |
| 36 |
parent::__construct(); |
| 37 |
|
| 38 |
add_action( 'elementor/controls/register', function ( $controls_manager ) { |
| 39 |
$controls_manager->register( new Controls\Control_Nested_Repeater() ); |
| 40 |
} ); |
| 41 |
|
| 42 |
add_action( 'elementor/editor/before_enqueue_scripts', function () { |
| 43 |
wp_enqueue_script( $this->get_name(), $this->get_js_assets_url( $this->get_name() ), [ |
| 44 |
'elementor-common', |
| 45 |
], ELEMENTOR_VERSION, true ); |
| 46 |
} ); |
| 47 |
} |
| 48 |
} |
| 49 |
|