| @@ -277,14 +277,14 @@ | ||
| 277 | 277 | |
| 278 | 278 | return $data_container; |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | - public static function iterate_elementor_documents( $callback, $batch_size = 100, $additional_post_types = [] ) { | |
| 281 | + public static function iterate_elementor_documents( $callback, $batch_size = 100 ) { | |
| 282 | 282 | $processed_posts = 0; |
| 283 | 283 | |
| 284 | 284 | while ( true ) { |
| 285 | 285 | $args = wp_parse_args( [ |
| 286 | - 'post_type' => array_merge( [ Source_Local::CPT, 'post', 'page' ], $additional_post_types ), | |
| 286 | + 'post_type' => [ Source_Local::CPT, 'post', 'page' ], | |
| 287 | 287 | 'post_status' => [ 'publish' ], |
| 288 | 288 | 'posts_per_page' => $batch_size, |
| 289 | 289 | 'meta_key' => Document::BUILT_WITH_ELEMENTOR_META_KEY, |
| 290 | 290 | 'meta_value' => 'builder', |
| @@ -303,9 +303,9 @@ | ||
| 303 | 303 | $elements_data = $document->get_json_meta( Document::ELEMENTOR_DATA_META_KEY ); |
| 304 | 304 | |
| 305 | 305 | $callback( $document, $elements_data ); |
| 306 | 306 | |
| 307 | - ++$processed_posts; | |
| 307 | + $processed_posts++; | |
| 308 | 308 | } |
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | |
| @@ -349,13 +349,12 @@ | ||
| 349 | 349 | * |
| 350 | 350 | * @since 1.1.0 |
| 351 | 351 | * @access public |
| 352 | 352 | * |
| 353 | - * @param int $from_post_id Original post ID. | |
| 354 | - * @param int $to_post_id Target post ID. | |
| 355 | - * @param ?array $specific_meta_keys Optional. Specific meta keys to copy. Default is null, which copies all elementor meta keys. | |
| 353 | + * @param int $from_post_id Original post ID. | |
| 354 | + * @param int $to_post_id Target post ID. | |
| 356 | 355 | */ |
| 357 | - public function copy_elementor_meta( $from_post_id, $to_post_id, $specific_meta_keys = null ) { | |
| 356 | + public function copy_elementor_meta( $from_post_id, $to_post_id ) { | |
| 358 | 357 | $from_post_meta = get_post_meta( $from_post_id ); |
| 359 | 358 | $core_meta = [ |
| 360 | 359 | '_wp_page_template', |
| 361 | 360 | '_thumbnail_id', |
| @@ -361,12 +360,8 @@ | ||
| 361 | 360 | '_thumbnail_id', |
| 362 | 361 | ]; |
| 363 | 362 | |
| 364 | 363 | foreach ( $from_post_meta as $meta_key => $values ) { |
| 365 | - if ( $specific_meta_keys && ! in_array( $meta_key, $specific_meta_keys, true ) ) { | |
| 366 | - continue; | |
| 367 | - } | |
| 368 | - | |
| 369 | 364 | // Copy only meta with the `_elementor` prefix. |
| 370 | 365 | if ( 0 === strpos( $meta_key, '_elementor' ) || in_array( $meta_key, $core_meta, true ) ) { |
| 371 | 366 | $value = $values[0]; |
| 372 | 367 | |