mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 08:11:52 +01:00
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. Built from https://develop.svn.wordpress.org/trunk@25182 git-svn-id: http://core.svn.wordpress.org/trunk@25154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d221f04e60
commit
93b2edbbba
@ -1292,7 +1292,7 @@ function register_post_type( $post_type, $args = array() ) {
|
||||
}
|
||||
|
||||
if ( $args->hierarchical )
|
||||
add_rewrite_tag( "%$post_type%", '(.+?)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name=" );
|
||||
add_rewrite_tag( "%$post_type%", '(.+?)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&pagename=" );
|
||||
else
|
||||
add_rewrite_tag( "%$post_type%", '([^/]+)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name=" );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user