Make WordPress Core

Changeset 34247

Timestamp:
09/16/2015 07:04:57 PM (9 years ago)
Author:
boonebgorges
Message:

Allow taxonomies to be non-public.

[13216] introduced the 'public' argument for register_taxonomy(). This param
was used to set defaults for 'show_ui' and a number of other params, but it
never did anything itself.

With this changeset, taxonomies registered with public=false will no longer
be queryable on the front end, ie via taxonomy archive queries.

Props wpsmith, ocean90, nacin, ericlewis, boonebgorges.
Fixes #21949.

Location:
trunk
Files:
3 edited

Legend:

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

    r34215 r34247  
    300300            if ( $t->query_var && isset( $this->query_vars[$t->query_var] ) )
    301301                $this->query_vars[$t->query_var] = str_replace( ' ', '+', $this->query_vars[$t->query_var] );
     302
     303
     304
     305
     306
     307
     308
     309
     310
     311
     312
     313
     314
     315
     316
    302317
    303318        // Limit publicly queried post_types to those that are publicly_queryable
  • trunk/src/wp-includes/taxonomy-functions.php

    r34246 r34247  
    279279 *     * You can see accepted values in {@link get_taxonomy_labels()}.
    280280 * - description - A short descriptive summary of what the taxonomy is for. Defaults to blank.
    281  * - public - If the taxonomy should be publicly queryable; //@TODO not implemented.
     281 * - public - If the taxonomy should be publicly queryable.
    282282 *     * Defaults to true.
    283283 * - hierarchical - Whether the taxonomy is hierarchical (e.g. category). Defaults to false.
  • trunk/tests/phpunit/tests/taxonomy.php

    r33182 r34247  
    443443        _unregister_post_type( 'wptests_pt' );
    444444    }
     445
     446
     447
     448
     449
     450
     451
     452
     453
     454
     455
     456
     457
     458
     459
     460
     461
     462
     463
     464
     465
     466
     467
     468
     469
     470
     471
     472
     473
     474
     475
     476
     477
     478
     479
     480
     481
     482
     483
     484
    445485}
Note: See TracChangeset for help on using the changeset viewer.