Make WordPress Core

Ticket #5305: 5305.diff

File 5305.diff, 1.3 KB (added by valendesigns, 10 years ago)
  • src/wp-includes/post.php

    diff --git src/wp-includes/post.php src/wp-includes/post.php
    index 3d1227f..b2d21a7 100644
    function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_p 
    36853685
    36863686        $original_slug = $slug;
    36873687
     3688        if ( is_numeric( $slug ) ) {
     3689                /**
     3690                 * Filter the prefix for numeric slugs.
     3691                 *
     3692                 * Prefixes numeric slugs so they do not collide with dates in some permalink structures.
     3693                 * The default prefix is the value of `$post_type` with a hyphen attached to the end.
     3694                 * For example, if the current post type is 'post', the default value will be 'post-'.
     3695                 *
     3696                 * @since 4.2.0
     3697                 *
     3698                 * @param string $slug_prefix   The numeric slug prefix.
     3699                 * @param string $slug          The post slug.
     3700                 * @param int    $post_ID       Post ID.
     3701                 * @param string $post_status   The post status.
     3702                 * @param string $post_type     Post type.
     3703                 * @param int    $post_parent   Post parent ID
     3704                 * @param string $original_slug The original post slug.
     3705                 */
     3706                $slug_prefix = apply_filters( 'wp_unique_post_slug_numeric_slug_prefix', $post_type . '-', $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug );
     3707
     3708                $slug = $slug_prefix . $slug;
     3709        }
     3710
    36883711        $feeds = $wp_rewrite->feeds;
    36893712        if ( ! is_array( $feeds ) )
    36903713                $feeds = array();