WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/30/2013 08:07:06 AM (6 years ago)
Author:
duck_
Message:

Correct rewrite tag for hierarchical post types without a query_var.

Hierarchical rewrite rules operate via the 'pagename' query variable which is
passed to get_page_by_path(). However, the current rewrite rules use the 'name'
query variable for hierarchical types without a custom query_var.

Fixes #16323.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r25169 r25182  
    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=" );
Note: See TracChangeset for help on using the changeset viewer.