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