| @@ -1,8 +1,7 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | namespace Elementor; |
| 3 | 3 | |
| 4 | -use Elementor\Core\Base\Document; | |
| 5 | 4 | use Elementor\Core\DocumentTypes\PageBase; |
| 6 | 5 | use Elementor\TemplateLibrary\Source_Local; |
| 7 | 6 | |
| 8 | 7 | if ( ! defined( 'ABSPATH' ) ) { |
| @@ -33,9 +32,8 @@ | ||
| 33 | 32 | public static function register_actions() { |
| 34 | 33 | add_action( 'init', [ __CLASS__, 'init' ] ); |
| 35 | 34 | |
| 36 | 35 | self::polylang_compatibility(); |
| 37 | - self::yoast_duplicate_post(); | |
| 38 | 36 | |
| 39 | 37 | if ( is_admin() || defined( 'WP_LOAD_IMPORTERS' ) ) { |
| 40 | 38 | add_filter( 'wp_import_post_meta', [ __CLASS__, 'on_wp_import_post_meta' ] ); |
| 41 | 39 | add_filter( 'wxr_importer.pre_process.post_meta', [ __CLASS__, 'on_wxr_importer_pre_process_post_meta' ] ); |
| @@ -268,29 +266,8 @@ | ||
| 268 | 266 | Plugin::$instance->db->copy_elementor_meta( $from, $to ); |
| 269 | 267 | } |
| 270 | 268 | |
| 271 | 269 | return $keys; |
| 272 | - } | |
| 273 | - | |
| 274 | - private static function yoast_duplicate_post() { | |
| 275 | - add_filter( 'duplicate_post_excludelist_filter', function( $meta_excludelist ) { | |
| 276 | - $exclude_list = [ | |
| 277 | - Document::TYPE_META_KEY, | |
| 278 | - '_elementor_page_assets', | |
| 279 | - '_elementor_controls_usage', | |
| 280 | - '_elementor_css', | |
| 281 | - '_elementor_screenshot', | |
| 282 | - ]; | |
| 283 | - | |
| 284 | - return array_merge( $meta_excludelist, $exclude_list ); | |
| 285 | - } ); | |
| 286 | - | |
| 287 | - add_action( 'duplicate_post_post_copy', function( $new_post_id, $post ) { | |
| 288 | - $original_template_type = get_post_meta( $post->ID, Document::TYPE_META_KEY, true ); | |
| 289 | - if ( ! empty( $original_template_type ) ) { | |
| 290 | - update_post_meta( $new_post_id, Document::TYPE_META_KEY, $original_template_type ); | |
| 291 | - } | |
| 292 | - }, 10, 2 ); | |
| 293 | 270 | } |
| 294 | 271 | |
| 295 | 272 | /** |
| 296 | 273 | * Process post meta before WP importer. |