PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.2
Elementor Website Builder – more than just a page builder v3.32.2
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 +7 -48 4.2.03.32.2 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,
@@ -651,14 +639,14 @@
651 639 * Fired by `post_row_actions` and `page_row_actions` filters.
652 640 *
653 641 * @access public
654 642 *
655 - * @param array $actions An array of row action links.
643 + * @param array $actions An array of row action links.
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 */
@@ -1069,10 +1049,8 @@
1069 1049 * @param null $data
1070 1050 * @param bool $with_html_content
1071 1051 *
1072 1052 * @return array
1073 - *
1074 - * @throws \Exception If elements retrieval fails or data processing errors occur.
1075 1053 */
1076 1054 public function get_elements_raw_data( $data = null, $with_html_content = false ) {
1077 1055 if ( ! static::get_property( 'has_elements' ) ) {
1078 1056 return [];
@@ -1081,23 +1059,8 @@
1081 1059 if ( is_null( $data ) ) {
1082 1060 $data = $this->get_elements_data();
1083 1061 }
1084 1062
1085 - /**
1086 - * Filters document elements data after loading.
1087 - *
1088 - * Allows modification of elements data when loading (not saving).
1089 - * Useful for migrations, transformations, or data enrichment.
1090 - *
1091 - * @since 3.35.0
1092 - *
1093 - * @param array $data The elements data array.
1094 - * @param \Elementor\Core\Base\Document $document The document instance.
1095 - */
1096 - if ( ! $this->is_saving ) {
1097 - $data = apply_filters( 'elementor/document/load/data', $data, $this );
1098 - }
1099 -
1100 1063 // Change the current documents, so widgets can use `documents->get_current` and other post data
1101 1064 Plugin::$instance->documents->switch_to_document( $this );
1102 1065
1103 1066 $editor_data = [];
@@ -1493,9 +1456,9 @@
1493 1456 * @since 2.0.4
1494 1457 * @access public
1495 1458 *
1496 1459 * @param string $key Meta data key.
1497 - * @param mixed $value Meta data value.
1460 + * @param mixed $value Meta data value.
1498 1461 *
1499 1462 * @return bool|int
1500 1463 */
1501 1464 public function update_main_meta( $key, $value ) {
@@ -1830,11 +1793,11 @@
1830 1793 }
1831 1794
1832 1795 /**
1833 1796 * @since 2.1.3
1834 - * @access public
1797 + * @access protected
1835 1798 */
1836 - public function print_elements( $elements_data ) {
1799 + protected function print_elements( $elements_data ) {
1837 1800 $is_element_cache_active = 'disable' !== get_option( 'elementor_element_cache_ttl', '' );
1838 1801 if ( ! $is_element_cache_active ) {
1839 1802 ob_start();
1840 1803
@@ -2124,10 +2087,6 @@
2124 2087 $this->elements_iteration_actions[] = new Assets_Iteration_Action( $this );
2125 2088 }
2126 2089
2127 2090 return $this->elements_iteration_actions;
2128 - }
2129 -
2130 - public function get_elementor_version() {
2131 - return $this->get_main_meta( '_elementor_version' );
2132 2091 }
2133 2092 }