Set $tax as the taxonomy object, and kill off our colliding global from menu construction. see #15326.

git-svn-id: https://develop.svn.wordpress.org/trunk@16253 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-11-09 03:28:09 +00:00
parent 68eba28b16
commit 4125fe393b
2 changed files with 2 additions and 1 deletions

View File

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

View File

@ -137,7 +137,7 @@ foreach ( (array) get_post_types( array('show_ui' => true, '_builtin' => false,
$submenu["edit.php?post_type=$ptype"][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, "edit-tags.php?taxonomy=$tax->name&post_type=$ptype" );
}
}
unset($ptype, $ptype_obj, $ptype_class, $ptype_for_id, $ptype_menu_position, $menu_icon, $i);
unset($ptype, $ptype_obj, $ptype_class, $ptype_for_id, $ptype_menu_position, $menu_icon, $i, $tax);
$menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' );