| @@ -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 | */ |
| @@ -1081,23 +1061,8 @@ | ||
| 1081 | 1061 | if ( is_null( $data ) ) { |
| 1082 | 1062 | $data = $this->get_elements_data(); |
| 1083 | 1063 | } |
| 1084 | 1064 | |
| 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 | 1065 | // Change the current documents, so widgets can use `documents->get_current` and other post data |
| 1101 | 1066 | Plugin::$instance->documents->switch_to_document( $this ); |
| 1102 | 1067 | |
| 1103 | 1068 | $editor_data = []; |
| @@ -2124,10 +2089,6 @@ | ||
| 2124 | 2089 | $this->elements_iteration_actions[] = new Assets_Iteration_Action( $this ); |
| 2125 | 2090 | } |
| 2126 | 2091 | |
| 2127 | 2092 | return $this->elements_iteration_actions; |
| 2128 | - } | |
| 2129 | - | |
| 2130 | - public function get_elementor_version() { | |
| 2131 | - return $this->get_main_meta( '_elementor_version' ); | |
| 2132 | 2093 | } |
| 2133 | 2094 | } |