| 1 |
<?php |
| 2 |
namespace Elementor\Modules\NestedAccordion; |
| 3 |
|
| 4 |
use Elementor\Core\Experiments\Manager; |
| 5 |
use Elementor\Plugin; |
| 6 |
use Elementor\Modules\NestedElements\Module as NestedElementsModule; |
| 7 |
use Elementor\Core\Base\Module as BaseModule; |
| 8 |
|
| 9 |
|
| 10 |
if ( ! defined( 'ABSPATH' ) ) { |
| 11 |
exit; // Exit if accessed directly |
| 12 |
} |
| 13 |
|
| 14 |
class Module extends BaseModule { |
| 15 |
|
| 16 |
const EXPERIMENT_NAME = 'nested-accordion'; |
| 17 |
|
| 18 |
public static function is_active() { |
| 19 |
return Plugin::$instance->experiments->is_feature_active( static::EXPERIMENT_NAME ); |
| 20 |
} |
| 21 |
|
| 22 |
public function get_name() { |
| 23 |
return static::EXPERIMENT_NAME; |
| 24 |
} |
| 25 |
|
| 26 |
public function get_widgets() { |
| 27 |
return [ |
| 28 |
'Nested_Accordion', |
| 29 |
]; |
| 30 |
} |
| 31 |
|
| 32 |
/** |
| 33 |
* Add to the experiments |
| 34 |
* |
| 35 |
* @return array |
| 36 |
*/ |
| 37 |
public static function get_experimental_data() { |
| 38 |
return [ |
| 39 |
'name' => static::EXPERIMENT_NAME, |
| 40 |
'title' => esc_html__( 'Nested Accordion', 'elementor' ), |
| 41 |
'description' => sprintf( |
| 42 |
/* translators: 1: Link opening tag, 2: Link closing tag. */ |
| 43 |
esc_html__( 'Create a rich user experience by layering widgets together inside “Nested” Accordion, etc. %1$sLearn More%2$s', 'elementor' ), |
| 44 |
'<a href="https://go.elementor.com/widget-nested-accordion" target="_blank">', |
| 45 |
'</a>' |
| 46 |
), |
| 47 |
'hidden' => true, |
| 48 |
'release_status' => Manager::RELEASE_STATUS_ALPHA, |
| 49 |
'default' => Manager::STATE_INACTIVE, |
| 50 |
'dependencies' => [ |
| 51 |
'nested-elements', |
| 52 |
], |
| 53 |
]; |
| 54 |
} |
| 55 |
|
| 56 |
public function __construct() { |
| 57 |
parent::__construct(); |
| 58 |
|
| 59 |
add_action( 'elementor/editor/before_enqueue_scripts', function () { |
| 60 |
wp_enqueue_script( $this->get_name(), $this->get_js_assets_url( $this->get_name() ), [ |
| 61 |
'nested-elements', |
| 62 |
], ELEMENTOR_VERSION, true ); |
| 63 |
} ); |
| 64 |
} |
| 65 |
} |
| 66 |
|