Make WordPress Core

Ticket #5305: wp-includes_post.php.diff

File wp-includes_post.php.diff, 693 bytes (added by loushou, 10 years ago)

wp-includes/post.php patch for handling numeric slugs

  • wp-includes/post.php

     
    36723672        global $wpdb, $wp_rewrite;
    36733673
    36743674        $original_slug = $slug;
     3675       
     3676        // if the name is numeric, then prefix it so that the post name will work with all permalink structures
     3677        // https://core.trac.wordpress.org/ticket/5305
     3678        if ( is_numeric( $slug ) ) {
     3679                $slug_prefix = apply_filters( 'wp_unique_post_slug_numeric_slug_prefix', 'number-', $slug, $post_ID, $post_status, $post_type, $post_parent );
     3680                $slug = $slug_prefix . $slug;
     3681        }
    36753682
    36763683        $feeds = $wp_rewrite->feeds;
    36773684        if ( ! is_array( $feeds ) )