WordPress.org

Make WordPress Core

Ticket #16323: 16323.hierarchical-rewrite-tag.diff

File 16323.hierarchical-rewrite-tag.diff, 628 bytes (added by duck_, 6 years ago)
  • src/wp-includes/post.php

     
    12921292                }
    12931293
    12941294                if ( $args->hierarchical )
    1295                         add_rewrite_tag( "%$post_type%", '(.+?)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name=" );
     1295                        add_rewrite_tag( "%$post_type%", '(.+?)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&pagename=" );
    12961296                else
    12971297                        add_rewrite_tag( "%$post_type%", '([^/]+)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name=" );
    12981298