| @@ -10,8 +10,9 @@ | ||
| 10 | 10 | use Elementor\Modules\AtomicWidgets\Elements\Atomic_Image\Atomic_Image; |
| 11 | 11 | use Elementor\Modules\AtomicWidgets\Elements\Atomic_Paragraph\Atomic_Paragraph; |
| 12 | 12 | use Elementor\Modules\AtomicWidgets\Elements\Atomic_Svg\Atomic_Svg; |
| 13 | 13 | use Elementor\Modules\NestedAccordion\Widgets\Nested_Accordion; |
| 14 | +use Elementor\Modules\NestedElements\Module as NestedElementsModule; | |
| 14 | 15 | use Elementor\Modules\NestedTabs\Widgets\NestedTabs; |
| 15 | 16 | |
| 16 | 17 | if ( ! defined( 'ABSPATH' ) ) { |
| 17 | 18 | exit; // Exit if accessed directly. |
| @@ -51,9 +52,9 @@ | ||
| 51 | 52 | * |
| 52 | 53 | * @return array |
| 53 | 54 | */ |
| 54 | 55 | private array $promoted_widgets = [ |
| 55 | - 'container' => [ | |
| 56 | + NestedElementsModule::EXPERIMENT_NAME => [ | |
| 56 | 57 | NestedTabs::class, |
| 57 | 58 | Nested_Accordion::class, |
| 58 | 59 | ], |
| 59 | 60 | 'atomic_widgets' => [ |
| @@ -407,35 +408,8 @@ | ||
| 407 | 408 | |
| 408 | 409 | return $config; |
| 409 | 410 | } |
| 410 | 411 | |
| 411 | - /** | |
| 412 | - * @throws \Exception If current user don't have permissions to edit the post. | |
| 413 | - */ | |
| 414 | - public function ajax_refresh_widgets_config( array $data ) { | |
| 415 | - Plugin::$instance->documents->check_permissions( $data['editor_post_id'] ); | |
| 416 | - | |
| 417 | - wp_raise_memory_limit( 'admin' ); | |
| 418 | - | |
| 419 | - $widgets = []; | |
| 420 | - | |
| 421 | - foreach ( $this->get_widget_types() as $widget_key => $widget ) { | |
| 422 | - $widget_config = $widget->get_config(); | |
| 423 | - | |
| 424 | - // get_config() omits controls when the stack isn't initialized yet (see Widget_Base::get_initial_config). | |
| 425 | - // During an AJAX refresh the instances are fresh, so we force-initialize and merge them explicitly. | |
| 426 | - $widget_config['controls'] = $widget->get_stack( false )['controls']; | |
| 427 | - $widget_config['tabs_controls'] = $widget->get_tabs_controls(); | |
| 428 | - | |
| 429 | - $widgets[ $widget_key ] = $widget_config; | |
| 430 | - } | |
| 431 | - | |
| 432 | - return [ | |
| 433 | - 'widgets' => $widgets, | |
| 434 | - 'categories' => Plugin::$instance->elements_manager->get_categories(), | |
| 435 | - ]; | |
| 436 | - } | |
| 437 | - | |
| 438 | 412 | public function ajax_get_widgets_default_value_translations( array $data = [] ) { |
| 439 | 413 | $locale = empty( $data['locale'] ) |
| 440 | 414 | ? get_locale() |
| 441 | 415 | : $data['locale']; |
| @@ -763,10 +737,8 @@ | ||
| 763 | 737 | public function register_ajax_actions( Ajax $ajax_manager ) { |
| 764 | 738 | $ajax_manager->register_ajax_action( 'render_widget', [ $this, 'ajax_render_widget' ] ); |
| 765 | 739 | $ajax_manager->register_ajax_action( 'editor_get_wp_widget_form', [ $this, 'ajax_get_wp_widget_form' ] ); |
| 766 | 740 | $ajax_manager->register_ajax_action( 'get_widgets_config', [ $this, 'ajax_get_widget_types_controls_config' ] ); |
| 767 | - | |
| 768 | - $ajax_manager->register_ajax_action( 'refresh_widgets_config', [ $this, 'ajax_refresh_widgets_config' ] ); | |
| 769 | 741 | |
| 770 | 742 | $ajax_manager->register_ajax_action( 'get_widgets_default_value_translations', function ( array $data ) { |
| 771 | 743 | return $this->ajax_get_widgets_default_value_translations( $data ); |
| 772 | 744 | } ); |