WordPress.org

Make WordPress Core

Changeset 18966


Ignore:
Timestamp:
10/13/2011 06:55:40 PM (8 years ago)
Author:
ryan
Message:

Avoid notices when viewing non-existent taxonomy. Props ocean90, johnbillion. fixes #18716

File:
1 edited

Legend:

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

    r18954 r18966  
    99/** WordPress Administration Bootstrap */
    1010require_once('./admin.php');
    11 $tax = get_taxonomy( $taxnow );
    12 if ( !current_user_can( $tax->cap->manage_terms ) )
     11
     12if ( ! isset( $_GET['taxonomy'] ) )
     13    $taxonomy = 'post_tag';
     14elseif ( in_array( $_GET['taxonomy'], get_taxonomies( array('show_ui' => true ) ) ) )
     15    $taxonomy = sanitize_key( $_GET['taxonomy'] );
     16else
     17    wp_die( __( 'Invalid taxonomy' ) );
     18
     19$_GET['taxonomy'] = $taxonomy;
     20
     21$tax = get_taxonomy( $taxonomy );
     22
     23if ( ! $tax )
     24    wp_die( __( 'Invalid taxonomy' ) );
     25
     26if ( ! current_user_can( $tax->cap->manage_terms ) )
    1327    wp_die( __( 'Cheatin’ uh?' ) );
    1428
Note: See TracChangeset for help on using the changeset viewer.