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

git-svn-id: http://svn.automattic.com/wordpress/trunk@16253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-11-09 03:28:09 +00:00
parent e58e4a2345
commit dc07485821
2 changed files with 2 additions and 1 deletions

View File

@ -8,6 +8,7 @@
/** WordPress Administration Bootstrap */ /** WordPress Administration Bootstrap */
require_once('./admin.php'); require_once('./admin.php');
$tax = get_taxonomy( $taxnow );
if ( !current_user_can( $tax->cap->manage_terms ) ) if ( !current_user_can( $tax->cap->manage_terms ) )
wp_die( __( 'Cheatin’ uh?' ) ); 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" ); $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' ); $menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' );