Ticket #20480: 20480.2.diff
File 20480.2.diff, 1.3 KB (added by , 12 years ago) |
---|
-
wp-includes/post.php
2821 2821 * Computes a unique slug for the post, when given the desired slug and some post details. 2822 2822 * 2823 2823 * @since 2.8.0 2824 * @uses $wpdb 2825 * @uses $wp_rewrite 2826 * @uses apply_filters() Calls 'pre_wp_unique_post_slug' with empty string and 2827 * all function arguments 2828 * @uses apply_filters() Calls 'wp_unique_post_slug' with resultant unique slug, 2829 * all function arguments, and the original slug 2824 2830 * 2825 2831 * @global wpdb $wpdb 2826 2832 * @global WP_Rewrite $wp_rewrite … … 2835 2841 if ( in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) ) 2836 2842 return $slug; 2837 2843 2844 $override_slug = apply_filters( 'pre_wp_unique_post_slug', '', $slug, $post_ID, $post_status, $post_type, $post_parent ); 2845 if ( $override_slug ) 2846 return $override_slug; 2847 2838 2848 global $wpdb, $wp_rewrite; 2839 2849 2850 $original_slug = $slug; 2851 2840 2852 $feeds = $wp_rewrite->feeds; 2841 2853 if ( ! is_array( $feeds ) ) 2842 2854 $feeds = array(); … … 2887 2899 } 2888 2900 } 2889 2901 2890 return apply_filters( 'wp_unique_post_slug', $slug, $post_ID, $post_status, $post_type, $post_parent );2902 return apply_filters( 'wp_unique_post_slug', $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ); 2891 2903 } 2892 2904 2893 2905 /**