PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.0-dev3
Elementor Website Builder – more than just a page builder v3.32.0-dev3
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 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | includes/managers/widgets.php +4 -38 4.3.0-beta13.32.0-dev3 View file →
@@ -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' => [
@@ -384,9 +385,9 @@
384 385 return $config;
385 386 }
386 387
387 388 /**
388 - * @throws \Exception If current user don't have permissions to edit the post.
389 + * @throws \Exception Exception.
389 390 */
390 391 public function ajax_get_widget_types_controls_config( array $data ) {
391 392 Plugin::$instance->documents->check_permissions( $data['editor_post_id'] );
392 393
@@ -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'];
@@ -519,9 +493,9 @@
519 493 *
520 494 * @param array $request Ajax request.
521 495 *
522 496 * @return bool|string Rendered widget form.
523 - * @throws \Exception If current user don't have permissions to edit the post.
497 + * @throws \Exception If there is an error processing the request.
524 498 */
525 499 public function ajax_get_wp_widget_form( $request ) {
526 500 Plugin::$instance->documents->check_permissions( $request['editor_post_id'] );
527 501
@@ -660,14 +634,8 @@
660 634 $widget->enqueue_scripts();
661 635 }
662 636 }
663 637
664 - public function register_frontend_handlers() {
665 - foreach ( $this->get_widget_types() as $widget ) {
666 - $widget->register_frontend_handlers();
667 - }
668 - }
669 -
670 638 /**
671 639 * Enqueue widgets styles
672 640 *
673 641 * Enqueue all the styles defined as a dependency for each widget
@@ -763,10 +731,8 @@
763 731 public function register_ajax_actions( Ajax $ajax_manager ) {
764 732 $ajax_manager->register_ajax_action( 'render_widget', [ $this, 'ajax_render_widget' ] );
765 733 $ajax_manager->register_ajax_action( 'editor_get_wp_widget_form', [ $this, 'ajax_get_wp_widget_form' ] );
766 734 $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 735
770 736 $ajax_manager->register_ajax_action( 'get_widgets_default_value_translations', function ( array $data ) {
771 737 return $this->ajax_get_widgets_default_value_translations( $data );
772 738 } );