Ticket #20419: ticket.20419.patch
File ticket.20419.patch, 1.8 KB (added by , 12 years ago) |
---|
-
wp-includes/post.php
2790 2790 * @param string $post_status no uniqueness checks are made if the post is still draft or pending 2791 2791 * @param string $post_type 2792 2792 * @param integer $post_parent 2793 * @param string $real_status Because this function bails on non-published statuses, this 2794 * gives the ability to pass a fake "publish" status via $post_status while sending the 2795 * real status to the wp_unique_post_slug filter 2793 2796 * @return string unique slug for the post, based on $post_name (with a -1, -2, etc. suffix) 2794 2797 */ 2795 function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_parent ) {2798 function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_parent, $real_status = null ) { 2796 2799 if ( in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) ) 2797 2800 return $slug; 2798 2801 2802 // If $real_status string was passed, we can now return the $post_status to 2803 // the real status. 2804 if ( $real_status && is_string( $real_status ) ) 2805 $post_status = $real_status; 2806 2799 2807 global $wpdb, $wp_rewrite; 2800 2808 2801 2809 $feeds = $wp_rewrite->feeds; -
wp-admin/includes/post.php
1032 1032 if ( !is_null($name) ) 1033 1033 $post->post_name = sanitize_title($name ? $name : $title, $post->ID); 1034 1034 1035 $post->post_name = wp_unique_post_slug( $post->post_name, $post->ID, $post->post_status, $post->post_type, $post->post_parent);1035 $post->post_name = wp_unique_post_slug( $post->post_name, $post->ID, $post->post_status, $post->post_type, $post->post_parent, $original_status ); 1036 1036 1037 1037 $post->filter = 'sample'; 1038 1038