Index: src/wp-includes/class-wp.php
===================================================================
--- src/wp-includes/class-wp.php	(révision 36279)
+++ src/wp-includes/class-wp.php	(copie de travail)
@@ -319,12 +319,12 @@
 			if ( $t->query_var && isset( $this->query_vars[$t->query_var] ) )
 				$this->query_vars[$t->query_var] = str_replace( ' ', '+', $this->query_vars[$t->query_var] );
 
-		// Don't allow non-public taxonomies to be queried from the front-end.
+		// Don't allow non-publicly queryable taxonomies to be queried from the front-end.
 		if ( ! is_admin() ) {
-			foreach ( get_taxonomies( array( 'public' => false ), 'objects' ) as $taxonomy => $t ) {
+			foreach ( get_taxonomies( array( 'publicly_queryable' => false ), 'objects' ) as $taxonomy => $t ) {
 				/*
 				 * Disallow when set to the 'taxonomy' query var.
-				 * Non-public taxonomies cannot register custom query vars. See register_taxonomy().
+				 * Non-publicly queryable taxonomies cannot register custom query vars. See register_taxonomy().
 				 */
 				if ( isset( $this->query_vars['taxonomy'] ) && $taxonomy === $this->query_vars['taxonomy'] ) {
 					unset( $this->query_vars['taxonomy'], $this->query_vars['term'] );
Index: src/wp-includes/taxonomy.php
===================================================================
--- src/wp-includes/taxonomy.php	(révision 36279)
+++ src/wp-includes/taxonomy.php	(copie de travail)
@@ -288,7 +288,13 @@
  *                                                taxonomies. See accepted values in get_taxonomy_labels().
  *                                                Default empty array.
  *     @type string        $description           A short descriptive summary of what the taxonomy is for. Default empty.
- *     @type bool          $public                Whether the taxonomy is publicly queryable. Default true.
+ *     @type bool          $public                Whether a taxonomy is intended for use publicly either via
+ *                                                the admin interface or by front-end users. While the default settings
+ *                                                of `$publicly_queryable`, `$show_ui`, and `$show_in_nav_menus`
+ *                                                are inherited from `$public`, each does not rely on this relationship
+ *                                                and controls a very specific intention (default true).
+ *     @type bool          $publicly_queryable    Whether the taxonomy is publicly queryable.
+ *                                                If not set, the default is inherited from `$public`
  *     @type bool          $hierarchical          Whether the taxonomy is hierarchical. Default false.
  *     @type bool          $show_ui               Whether to generate and allow a UI for managing terms in this taxonomy in
  *                                                the admin. If not set, the default is inherited from `$public`
@@ -362,6 +368,7 @@
 		'labels'                => array(),
 		'description'           => '',
 		'public'                => true,
+		'publicly_queryable'    => null,
 		'hierarchical'          => false,
 		'show_ui'               => null,
 		'show_in_menu'          => null,
@@ -383,8 +390,13 @@
 		return new WP_Error( 'taxonomy_length_invalid', __( 'Taxonomy names must be between 1 and 32 characters in length.' ) );
 	}
 
-	// Non-public taxonomies should not register query vars, except in the admin.
-	if ( false !== $args['query_var'] && ( is_admin() || false !== $args['public'] ) && ! empty( $wp ) ) {
+	// If not set, default to the setting for public.
+	if ( null === $args['publicly_queryable'] ) {
+		$args['publicly_queryable'] = $args['public'];
+	}
+
+	// Non-publicly queryable taxonomies should not register query vars, except in the admin.
+	if ( false !== $args['query_var'] && ( is_admin() || false !== $args['publicly_queryable'] ) && ! empty( $wp ) ) {
 		if ( true === $args['query_var'] )
 			$args['query_var'] = $taxonomy;
 		else
Index: tests/phpunit/includes/utils.php
===================================================================
--- tests/phpunit/includes/utils.php	(révision 36279)
+++ tests/phpunit/includes/utils.php	(copie de travail)
@@ -369,7 +369,7 @@
 		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 );
 	}
 
@@ -410,7 +410,7 @@
  */
 function benchmark_pcre_backtracking( $pattern, $subject, $strategy ) {
 	$saved_config = ini_get( 'pcre.backtrack_limit' );
-	
+
 	// Attempt to prevent PHP crashes.  Adjust these lower when needed.
 	if ( version_compare( phpversion(), '5.4.8', '>' ) ) {
 		$limit = 1000000;
@@ -422,7 +422,7 @@
 	for( $i = 4; $i <= $limit; $i *= 2 ) {
 
 		ini_set( 'pcre.backtrack_limit', $i );
-		
+
 		switch( $strategy ) {
 		case 'split':
 			preg_split( $pattern, $subject );
Index: tests/phpunit/tests/taxonomy.php
===================================================================
--- tests/phpunit/tests/taxonomy.php	(révision 36279)
+++ tests/phpunit/tests/taxonomy.php	(copie de travail)
@@ -446,9 +446,9 @@
 	/**
 	 * @ticket 21949
 	 */
-	public function test_nonpublic_taxonomy_should_not_be_queryable_using_taxname_query_var() {
+	public function test_nonpublicly_queryable_taxonomy_should_not_be_queryable_using_taxname_query_var() {
 		register_taxonomy( 'wptests_tax', 'post', array(
-			'public' => false,
+			'publicly_queryable' => false,
 		) );
 
 		$t = self::factory()->term->create_and_get( array(
@@ -466,11 +466,11 @@
 	/**
 	 * @ticket 21949
 	 */
-	public function test_it_should_be_possible_to_register_a_query_var_that_matches_the_name_of_a_nonpublic_taxonomy() {
+	public function test_it_should_be_possible_to_register_a_query_var_that_matches_the_name_of_a_nonpublicly_queryable_taxonomy() {
 		global $wp;
 
 		register_taxonomy( 'wptests_tax', 'post', array(
-			'public' => false,
+			'publicly_queryable' => false,
 		) );
 		$t = $this->factory->term->create_and_get( array(
 			'taxonomy' => 'wptests_tax',
@@ -501,9 +501,9 @@
 	/**
 	 * @ticket 21949
 	 */
-	public function test_nonpublic_taxonomy_should_not_be_queryable_using_taxonomy_and_term_vars() {
+	public function test_nonpublicly_queryable_taxonomy_should_not_be_queryable_using_taxonomy_and_term_vars() {
 		register_taxonomy( 'wptests_tax', 'post', array(
-			'public' => false,
+			'publicly_queryable' => false,
 		) );
 
 		$t = self::factory()->term->create_and_get( array(
@@ -519,6 +519,50 @@
 	}
 
 	/**
+	 * @ticket 34491
+	 */
+	public function test_public_taxonomy_should_be_publicly_queryable() {
+		register_taxonomy( 'wptests_tax', 'post', array(
+			'public' => true,
+		) );
+
+		$this->assertContains( 'wptests_tax', get_taxonomies( array( 'publicly_queryable' => true ) ) );
+
+		$t = self::factory()->term->create_and_get( array(
+			'taxonomy' => 'wptests_tax',
+		) );
+
+		$p = self::factory()->post->create();
+		wp_set_object_terms( $p, $t->slug, 'wptests_tax' );
+
+		$this->go_to( '/?wptests_tax=' . $t->slug );
+
+		$this->assertTrue( is_tax( 'wptests_tax' ) );
+	}
+
+	/**
+	 * @ticket 34491
+	 */
+	public function test_private_taxonomy_should_not_be_publicly_queryable() {
+		register_taxonomy( 'wptests_tax', 'post', array(
+			'public' => false,
+		) );
+
+		$this->assertContains( 'wptests_tax', get_taxonomies( array( 'publicly_queryable' => false ) ) );
+
+		$t = self::factory()->term->create_and_get( array(
+			'taxonomy' => 'wptests_tax',
+		) );
+
+		$p = self::factory()->post->create();
+		wp_set_object_terms( $p, $t->slug, 'wptests_tax' );
+
+		$this->go_to( '/?wptests_tax=' . $t->slug );
+
+		$this->assertFalse( is_tax( 'wptests_tax' ) );
+	}
+
+	/**
 	 * @ticket 35089
 	 */
 	public function test_query_var_should_be_forced_to_false_for_non_public_taxonomy() {
