| @@ -46,10 +46,8 @@ | ||
| 46 | 46 | const BUILT_WITH_ELEMENTOR_META_KEY = '_elementor_edit_mode'; |
| 47 | 47 | |
| 48 | 48 | const CACHE_META_KEY = '_elementor_element_cache'; |
| 49 | 49 | |
| 50 | - const UNEDITABLE_WITH_ELEMENTOR_TYPES = [ 'kit' ]; | |
| 51 | - | |
| 52 | 50 | /** |
| 53 | 51 | * Document publish status. |
| 54 | 52 | */ |
| 55 | 53 | const STATUS_PUBLISH = 'publish'; |
| @@ -232,16 +230,9 @@ | ||
| 232 | 230 | * |
| 233 | 231 | * @return array |
| 234 | 232 | */ |
| 235 | 233 | 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 ) { | |
| 234 | + if ( ! $has_pro ) { | |
| 244 | 235 | $categories[ $index ]['promotion'] = Filtered_Promotions_Manager::get_filtered_promotion_data( |
| 245 | 236 | $promotion, |
| 246 | 237 | 'elementor/panel/' . $index . '/custom_promotion', |
| 247 | 238 | 'url' |
| @@ -617,12 +608,8 @@ | ||
| 617 | 608 | |
| 618 | 609 | if ( $autosave_id ) { |
| 619 | 610 | $document = Plugin::$instance->documents->get( $autosave_id ); |
| 620 | 611 | } elseif ( $create ) { |
| 621 | - if ( ! function_exists( 'wp_create_post_autosave' ) ) { | |
| 622 | - require_once ABSPATH . 'wp-admin/includes/post.php'; | |
| 623 | - } | |
| 624 | - | |
| 625 | 612 | $autosave_id = wp_create_post_autosave( [ |
| 626 | 613 | 'post_ID' => $this->post->ID, |
| 627 | 614 | 'post_type' => $this->post->post_type, |
| 628 | 615 | 'post_title' => $this->post->post_title, |
| @@ -656,9 +643,9 @@ | ||
| 656 | 643 | * |
| 657 | 644 | * @return array An updated array of row action links. |
| 658 | 645 | */ |
| 659 | 646 | public function filter_admin_row_actions( $actions ) { |
| 660 | - if ( $this->is_editable_with_elementor() ) { | |
| 647 | + if ( $this->is_built_with_elementor() && $this->is_editable_by_current_user() ) { | |
| 661 | 648 | $actions['edit_with_elementor'] = sprintf( |
| 662 | 649 | '<a href="%1$s">%2$s</a>', |
| 663 | 650 | $this->get_edit_url(), |
| 664 | 651 | __( 'Edit with Elementor', 'elementor' ) |
| @@ -667,16 +654,8 @@ | ||
| 667 | 654 | |
| 668 | 655 | return $actions; |
| 669 | 656 | } |
| 670 | 657 | |
| 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 | 658 | /** |
| 680 | 659 | * @since 2.0.0 |
| 681 | 660 | * @access public |
| 682 | 661 | */ |
| @@ -853,9 +832,11 @@ | ||
| 853 | 832 | */ |
| 854 | 833 | do_action( 'elementor/document/before_save', $this, $data ); |
| 855 | 834 | |
| 856 | 835 | if ( ! current_user_can( 'unfiltered_html' ) ) { |
| 857 | - $data = Utils::kses_post_deep( $data ); | |
| 836 | + $data = map_deep( $data, function ( $value ) { | |
| 837 | + return is_bool( $value ) || is_null( $value ) ? $value : wp_kses_post( $value ); | |
| 838 | + } ); | |
| 858 | 839 | } |
| 859 | 840 | |
| 860 | 841 | if ( ! empty( $data['settings'] ) ) { |
| 861 | 842 | if ( isset( $data['settings']['post_status'] ) && self::STATUS_AUTOSAVE === $data['settings']['post_status'] ) { |
| @@ -2122,10 +2103,6 @@ | ||
| 2122 | 2103 | $this->elements_iteration_actions[] = new Assets_Iteration_Action( $this ); |
| 2123 | 2104 | } |
| 2124 | 2105 | |
| 2125 | 2106 | return $this->elements_iteration_actions; |
| 2126 | - } | |
| 2127 | - | |
| 2128 | - public function get_elementor_version() { | |
| 2129 | - return $this->get_main_meta( '_elementor_version' ); | |
| 2130 | 2107 | } |
| 2131 | 2108 | } |