PluginProbe
Elementor Website Builder – more than just a page builder / 3.34.3
Elementor Website Builder – more than just a page builder v3.34.3
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 4.0.7 All 451 releases
← All changes | core/base/document.php +6 -43 4.2.13.34.3 View file →
@@ -19,8 +19,9 @@
19 19 use Elementor\Widget_Base;
20 20 use Elementor\Core\Settings\Page\Manager as PageManager;
21 21 use ElementorPro\Modules\Library\Widgets\Template;
22 22 use Elementor\Core\Utils\Promotions\Filtered_Promotions_Manager;
23 +use Elementor\Modules\AtomicWidgets\Module as Atomic_Widgets_Module;
23 24
24 25 if ( ! defined( 'ABSPATH' ) ) {
25 26 exit; // Exit if accessed directly.
26 27 }
@@ -46,10 +47,8 @@
46 47 const BUILT_WITH_ELEMENTOR_META_KEY = '_elementor_edit_mode';
47 48
48 49 const CACHE_META_KEY = '_elementor_element_cache';
49 50
50 - const UNEDITABLE_WITH_ELEMENTOR_TYPES = [ 'kit' ];
51 -
52 51 /**
53 52 * Document publish status.
54 53 */
55 54 const STATUS_PUBLISH = 'publish';
@@ -232,16 +231,9 @@
232 231 *
233 232 * @return array
234 233 */
235 234 private static function get_panel_category_item( $promotion, $index, array $categories, bool $has_pro ): array {
236 - $keep_promotion = $has_pro && apply_filters(
237 - 'elementor/document/panel_category_keep_promotion',
238 - false,
239 - $index,
240 - $promotion
241 - );
242 -
243 - if ( ! $has_pro || $keep_promotion ) {
235 + if ( ! $has_pro ) {
244 236 $categories[ $index ]['promotion'] = Filtered_Promotions_Manager::get_filtered_promotion_data(
245 237 $promotion,
246 238 'elementor/panel/' . $index . '/custom_promotion',
247 239 'url'
@@ -617,12 +609,8 @@
617 609
618 610 if ( $autosave_id ) {
619 611 $document = Plugin::$instance->documents->get( $autosave_id );
620 612 } elseif ( $create ) {
621 - if ( ! function_exists( 'wp_create_post_autosave' ) ) {
622 - require_once ABSPATH . 'wp-admin/includes/post.php';
623 - }
624 -
625 613 $autosave_id = wp_create_post_autosave( [
626 614 'post_ID' => $this->post->ID,
627 615 'post_type' => $this->post->post_type,
628 616 'post_title' => $this->post->post_title,
@@ -656,9 +644,9 @@
656 644 *
657 645 * @return array An updated array of row action links.
658 646 */
659 647 public function filter_admin_row_actions( $actions ) {
660 - if ( $this->is_editable_with_elementor() ) {
648 + if ( $this->is_built_with_elementor() && $this->is_editable_by_current_user() ) {
661 649 $actions['edit_with_elementor'] = sprintf(
662 650 '<a href="%1$s">%2$s</a>',
663 651 $this->get_edit_url(),
664 652 __( 'Edit with Elementor', 'elementor' )
@@ -667,16 +655,8 @@
667 655
668 656 return $actions;
669 657 }
670 658
671 - public function is_editable_with_elementor() {
672 - if ( in_array( $this->get_type(), self::UNEDITABLE_WITH_ELEMENTOR_TYPES ) ) {
673 - return false;
674 - }
675 -
676 - return $this->is_editable_by_current_user() && $this->is_built_with_elementor();
677 - }
678 -
679 659 /**
680 660 * @since 2.0.0
681 661 * @access public
682 662 */
@@ -853,9 +833,11 @@
853 833 */
854 834 do_action( 'elementor/document/before_save', $this, $data );
855 835
856 836 if ( ! current_user_can( 'unfiltered_html' ) ) {
857 - $data = Utils::kses_post_deep( $data );
837 + $data = map_deep( $data, function ( $value ) {
838 + return is_bool( $value ) || is_null( $value ) ? $value : wp_kses_post( $value );
839 + } );
858 840 }
859 841
860 842 if ( ! empty( $data['settings'] ) ) {
861 843 if ( isset( $data['settings']['post_status'] ) && self::STATUS_AUTOSAVE === $data['settings']['post_status'] ) {
@@ -1079,23 +1061,8 @@
1079 1061 if ( is_null( $data ) ) {
1080 1062 $data = $this->get_elements_data();
1081 1063 }
1082 1064
1083 - /**
1084 - * Filters document elements data after loading.
1085 - *
1086 - * Allows modification of elements data when loading (not saving).
1087 - * Useful for migrations, transformations, or data enrichment.
1088 - *
1089 - * @since 3.35.0
1090 - *
1091 - * @param array $data The elements data array.
1092 - * @param \Elementor\Core\Base\Document $document The document instance.
1093 - */
1094 - if ( ! $this->is_saving ) {
1095 - $data = apply_filters( 'elementor/document/load/data', $data, $this );
1096 - }
1097 -
1098 1065 // Change the current documents, so widgets can use `documents->get_current` and other post data
1099 1066 Plugin::$instance->documents->switch_to_document( $this );
1100 1067
1101 1068 $editor_data = [];
@@ -2122,10 +2089,6 @@
2122 2089 $this->elements_iteration_actions[] = new Assets_Iteration_Action( $this );
2123 2090 }
2124 2091
2125 2092 return $this->elements_iteration_actions;
2126 - }
2127 -
2128 - public function get_elementor_version() {
2129 - return $this->get_main_meta( '_elementor_version' );
2130 2093 }
2131 2094 }