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

git-svn-id: http://svn.automattic.com/wordpress/trunk@18966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2011-10-13 18:55:40 +00:00
parent a733b40730
commit 99d80d6b4a
1 changed files with 16 additions and 2 deletions

View File

@ -8,8 +8,22 @@
/** WordPress Administration Bootstrap */
require_once('./admin.php');
$tax = get_taxonomy( $taxnow );
if ( !current_user_can( $tax->cap->manage_terms ) )
if ( ! isset( $_GET['taxonomy'] ) )
$taxonomy = 'post_tag';
elseif ( in_array( $_GET['taxonomy'], get_taxonomies( array('show_ui' => true ) ) ) )
$taxonomy = sanitize_key( $_GET['taxonomy'] );
else
wp_die( __( 'Invalid taxonomy' ) );
$_GET['taxonomy'] = $taxonomy;
$tax = get_taxonomy( $taxonomy );
if ( ! $tax )
wp_die( __( 'Invalid taxonomy' ) );
if ( ! current_user_can( $tax->cap->manage_terms ) )
wp_die( __( 'Cheatin’ uh?' ) );
$wp_list_table = _get_list_table('WP_Terms_List_Table');