WordPress.org

Make WordPress Core

Changeset 34359


Ignore:
Timestamp:
09/20/2015 05:10:55 PM (5 years ago)
Author:
johnbillion
Message:

Remove the ability to view the term editing screen for taxonomies with show_ui set to false. It is unexpected and unintended behaviour that this is allowed.

If your plugin or site does rely on this behaviour, the arguments that are passed to register_taxonomy() should be altered so that show_ui is true, and arguments such as show_in_menu and show_in_nav_menus are false.

Fixes #33938

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-tags.php

    r34306 r34359  
    1717if ( ! $tax )
    1818    wp_die( __( 'Invalid taxonomy' ) );
     19
     20if ( ! in_array( $tax->name, get_taxonomies( array( 'show_ui' => true ) ) ) ) {
     21   wp_die( __( 'You are not allowed to manage these items.' ) );
     22}
    1923
    2024if ( ! current_user_can( $tax->cap->manage_terms ) ) {
  • trunk/src/wp-includes/taxonomy-functions.php

    r34247 r34359  
    282282 *     * Defaults to true.
    283283 * - hierarchical - Whether the taxonomy is hierarchical (e.g. category). Defaults to false.
    284  * - show_ui - Whether to generate a default UI for managing this taxonomy in the admin.
     284 * - show_ui - Whether to generate and allow a UI for managing terms in this taxonomy in the admin.
    285285 *     * If not set, the default is inherited from public.
    286286 * - show_in_menu - Whether to show the taxonomy in the admin menu.
     
    324324 * @since 2.3.0
    325325 * @since 4.2.0 Introduced `show_in_quick_edit` argument.
     326 * @since 4.4.0 The `show_ui` argument is now enforced on the term editing screen.
    326327 *
    327328 * @global array $wp_taxonomies Registered taxonomies.
Note: See TracChangeset for help on using the changeset viewer.