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

git-svn-id: https://develop.svn.wordpress.org/trunk@18966 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2011-10-13 18:55:40 +00:00
parent 4685bc4b99
commit 44c051923e
1 changed files with 16 additions and 2 deletions

View File

@ -8,7 +8,21 @@
/** WordPress Administration Bootstrap */ /** WordPress Administration Bootstrap */
require_once('./admin.php'); require_once('./admin.php');
$tax = get_taxonomy( $taxnow );
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 ) ) if ( ! current_user_can( $tax->cap->manage_terms ) )
wp_die( __( 'Cheatin’ uh?' ) ); wp_die( __( 'Cheatin’ uh?' ) );