Ticket #33721: wordpress-importer.php.diff
File wordpress-importer.php.diff, 1.3 KB (added by , 10 years ago) |
---|
-
wordpress-importer.php
553 553 $post_type_object = get_post_type_object( $post['post_type'] ); 554 554 555 555 $post_exists = post_exists( $post['post_title'], '', $post['post_date'] ); 556 557 /** 558 * Filter ID of the existing post corresponding to post currently importing. 559 * 560 * Return 0 to force the post to be imported. Filter the ID to be something else 561 * to override which existing post is mapped to the imported post. 562 * 563 * @see post_exists() 564 * @since 0.6.2 565 * 566 * @param int $post_exists Post ID, or 0 if post did not exist. 567 */ 568 $post_exists = apply_filters( 'wp_import_existing_post', $post_exists, $post ); 569 556 570 if ( $post_exists && get_post_type( $post_exists ) == $post['post_type'] ) { 557 571 printf( __('%s “%s” already exists.', 'wordpress-importer'), $post_type_object->labels->singular_name, esc_html($post['post_title']) ); 558 572 echo '<br />'; 559 573 $comment_post_ID = $post_id = $post_exists; 574 $this->processed_posts[ intval( $post['post_id'] ) ] = intval( $post_exists ); 560 575 } else { 561 576 $post_parent = (int) $post['post_parent']; 562 577 if ( $post_parent ) {