PluginProbe
Elementor Website Builder – more than just a page builder / 3.28.0-dev2
Elementor Website Builder – more than just a page builder v3.28.0-dev2
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 4.1.0-beta2 4.1.0-dev2 All 455 releases
← All changes | includes/managers/widgets.php +5 -40 4.3.0-beta1 → 3.28.0-dev2 View file →
@@ -2,16 +2,17 @@
2 2 namespace Elementor;
3 3
4 4 use Elementor\Core\Common\Modules\Ajax\Module as Ajax;
5 5 use Elementor\Core\Utils\Collection;
6 +use Elementor\Core\Utils\Exceptions;
6 7 use Elementor\Core\Utils\Force_Locale;
7 8 use Elementor\Modules\AtomicWidgets\Elements\Atomic_Button\Atomic_Button;
8 -use Elementor\Modules\AtomicWidgets\Elements\Atomic_Divider\Atomic_Divider;
9 9 use Elementor\Modules\AtomicWidgets\Elements\Atomic_Heading\Atomic_Heading;
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' => [
@@ -61,9 +62,8 @@
61 62 Atomic_Image::class,
62 63 Atomic_Paragraph::class,
63 64 Atomic_Button::class,
64 65 Atomic_Svg::class,
65 - Atomic_Divider::class,
66 66 ],
67 67 ];
68 68
69 69 /**
@@ -384,9 +384,9 @@
384 384 return $config;
385 385 }
386 386
387 387 /**
388 - * @throws \Exception If current user don't have permissions to edit the post.
388 + * @throws \Exception Exception.
389 389 */
390 390 public function ajax_get_widget_types_controls_config( array $data ) {
391 391 Plugin::$instance->documents->check_permissions( $data['editor_post_id'] );
392 392
@@ -407,35 +407,8 @@
407 407
408 408 return $config;
409 409 }
410 410
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 411 public function ajax_get_widgets_default_value_translations( array $data = [] ) {
439 412 $locale = empty( $data['locale'] )
440 413 ? get_locale()
441 414 : $data['locale'];
@@ -519,9 +492,9 @@
519 492 *
520 493 * @param array $request Ajax request.
521 494 *
522 495 * @return bool|string Rendered widget form.
523 - * @throws \Exception If current user don't have permissions to edit the post.
496 + * @throws \Exception If there is an error processing the request.
524 497 */
525 498 public function ajax_get_wp_widget_form( $request ) {
526 499 Plugin::$instance->documents->check_permissions( $request['editor_post_id'] );
527 500
@@ -660,14 +633,8 @@
660 633 $widget->enqueue_scripts();
661 634 }
662 635 }
663 636
664 - public function register_frontend_handlers() {
665 - foreach ( $this->get_widget_types() as $widget ) {
666 - $widget->register_frontend_handlers();
667 - }
668 - }
669 -
670 637 /**
671 638 * Enqueue widgets styles
672 639 *
673 640 * Enqueue all the styles defined as a dependency for each widget
@@ -763,10 +730,8 @@
763 730 public function register_ajax_actions( Ajax $ajax_manager ) {
764 731 $ajax_manager->register_ajax_action( 'render_widget', [ $this, 'ajax_render_widget' ] );
765 732 $ajax_manager->register_ajax_action( 'editor_get_wp_widget_form', [ $this, 'ajax_get_wp_widget_form' ] );
766 733 $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 734
770 735 $ajax_manager->register_ajax_action( 'get_widgets_default_value_translations', function ( array $data ) {
771 736 return $this->ajax_get_widgets_default_value_translations( $data );
772 737 } );