Ticket #20419: 20419-override-post_status.patch
File 20419-override-post_status.patch, 1.3 KB (added by , 12 years ago) |
---|
-
wp-includes/post.php
2833 2833 * @return string unique slug for the post, based on $post_name (with a -1, -2, etc. suffix) 2834 2834 */ 2835 2835 function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_parent ) { 2836 if ( in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) ) 2836 if ( 'sample-' === substr( $post_status, 0, 7) ) 2837 $post_status = substr( $post_status, 7, strlen($post_status) ); 2838 elseif ( in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) ) 2837 2839 return $slug; 2838 2840 2839 2841 global $wpdb, $wp_rewrite; -
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, 'sample-' . $post->post_status, $post->post_type, $post->post_parent ); 1038 1038 1039 1039 $post->filter = 'sample'; 1040 1040