mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 22:57:20 +00:00
In WP::parse_request(), don't add query vars of non-viewable post types to WP::public_query_vars. In register_post_type(), don't add query vars of non-viewable post types to WP::public_query_vars.
In `_unregister_post_type()` (unit tests), don't add query vars of non-viewable post types to `WP::public_query_vars`. Adds unit test. Fixes #30018. git-svn-id: https://develop.svn.wordpress.org/trunk@34215 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -362,7 +362,7 @@ function _cleanup_query_vars() {
|
||||
}
|
||||
|
||||
foreach ( get_post_types( array() , 'objects' ) as $t ) {
|
||||
if ( ! empty( $t->query_var ) )
|
||||
if ( is_post_type_viewable( $t ) && ! empty( $t->query_var ) )
|
||||
$GLOBALS['wp']->add_query_var( $t->query_var );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user