Ticket #20419: 20419-extra-param.patch
File 20419-extra-param.patch, 1.8 KB (added by , 12 years ago) |
---|
-
wp-includes/post.php
2830 2830 * @param string $post_status no uniqueness checks are made if the post is still draft or pending 2831 2831 * @param string $post_type 2832 2832 * @param integer $post_parent 2833 * @param string $real_status Because this function bails on non-published statuses, this gives 2834 * the ability to pass a fake "publish" status via $post_status while sending the real status 2835 * to the wp_unique_post_slug filter 2833 2836 * @return string unique slug for the post, based on $post_name (with a -1, -2, etc. suffix) 2834 2837 */ 2835 function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_parent ) {2838 function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_parent, $real_status = null ) { 2836 2839 if ( in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) ) 2837 2840 return $slug; 2838 2841 2842 // If $real_status string was passed, we can now return the $post_status to 2843 // the real status. 2844 if ( $real_status && is_string( $real_status ) ) 2845 $post_status = $real_status; 2846 2839 2847 global $wpdb, $wp_rewrite; 2840 2848 2841 2849 $original_slug = $slug; -
wp-admin/includes/post.php
1034 1034 if ( !is_null($name) ) 1035 1035 $post->post_name = sanitize_title($name ? $name : $title, $post->ID); 1036 1036 1037 $post->post_name = wp_unique_post_slug( $post->post_name, $post->ID, $post->post_status, $post->post_type, $post->post_parent);1037 $post->post_name = wp_unique_post_slug( $post->post_name, $post->ID, $post->post_status, $post->post_type, $post->post_parent, $original_status ); 1038 1038 1039 1039 $post->filter = 'sample'; 1040 1040