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:
parent
4685bc4b99
commit
44c051923e
|
@ -8,7 +8,21 @@
|
|||
|
||||
/** WordPress Administration Bootstrap */
|
||||
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 ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
|
||||
|
|
Loading…
Reference in New Issue