PluginProbe
Elementor Website Builder – more than just a page builder / 3.14.0-beta4
Elementor Website Builder – more than just a page builder v3.14.0-beta4
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 All 457 releases
← All changes | modules/nested-accordion/module.php +37 -22 4.2.1 → 3.14.0-beta4 View file →
@@ -1,50 +1,65 @@
1 1 <?php
2 2 namespace Elementor\Modules\NestedAccordion;
3 3
4 +use Elementor\Core\Experiments\Manager;
4 5 use Elementor\Plugin;
6 +use Elementor\Modules\NestedElements\Module as NestedElementsModule;
5 7 use Elementor\Core\Base\Module as BaseModule;
6 8
7 9
8 10 if ( ! defined( 'ABSPATH' ) ) {
9 - exit; // Exit if accessed directly.
11 + exit; // Exit if accessed directly
10 12 }
11 13
12 14 class Module extends BaseModule {
13 15
16 + const EXPERIMENT_NAME = 'nested-accordion';
17 +
14 18 public static function is_active() {
15 - return Plugin::$instance->experiments->is_feature_active( 'nested-elements', true );
19 + return Plugin::$instance->experiments->is_feature_active( static::EXPERIMENT_NAME );
16 20 }
17 21
18 22 public function get_name() {
19 - return 'nested-accordion';
23 + return static::EXPERIMENT_NAME;
20 24 }
21 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 +
22 56 public function __construct() {
23 57 parent::__construct();
24 58
25 - add_action( 'elementor/frontend/after_register_styles', [ $this, 'register_styles' ] );
26 -
27 59 add_action( 'elementor/editor/before_enqueue_scripts', function () {
28 60 wp_enqueue_script( $this->get_name(), $this->get_js_assets_url( $this->get_name() ), [
29 61 'nested-elements',
30 62 ], ELEMENTOR_VERSION, true );
31 63 } );
32 - }
33 -
34 - /**
35 - * Register styles.
36 - *
37 - * At build time, Elementor compiles `/modules/nested-accordion/assets/scss/frontend.scss`
38 - * to `/assets/css/widget-nested-accordion.min.css`.
39 - *
40 - * @return void
41 - */
42 - public function register_styles() {
43 - wp_register_style(
44 - 'widget-nested-accordion',
45 - $this->get_css_assets_url( 'widget-nested-accordion', null, true, true ),
46 - [ 'elementor-frontend' ],
47 - ELEMENTOR_VERSION
48 - );
49 64 }
50 65 }