Introduce publicly_queryable taxonomy argument.

Taxonomies registered as `publicly_queryable` can be queried as taxonomy
archives.

If not provided explicitly, the value of `publicly_queryable` is inherited
from `public`.

Props Chouby.
Fixes #34491.

git-svn-id: https://develop.svn.wordpress.org/trunk@36525 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges
2016-02-13 03:50:37 +00:00
parent d03ae82c32
commit 7f87a14808
4 changed files with 91 additions and 13 deletions

View File

@@ -362,7 +362,7 @@ function _cleanup_query_vars() {
unset( $GLOBALS[$v] );
foreach ( get_taxonomies( array() , 'objects' ) as $t ) {
if ( $t->public && ! empty( $t->query_var ) )
if ( $t->publicly_queryable && ! empty( $t->query_var ) )
$GLOBALS['wp']->add_query_var( $t->query_var );
}