Changeset 14049
- Timestamp:
- 04/10/2010 10:48:30 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/menu.php
r14014 r14049 115 115 116 116 foreach ( (array) get_post_types( array('show_ui' => true) ) as $ptype ) { 117 $_wp_last_object_menu++;118 117 $ptype_obj = get_post_type_object($ptype); 119 $ptype_menu_position = is_int( $ptype_obj->menu_position ) ? $ptype_obj->menu_position : $_wp_last_object_menu;118 $ptype_menu_position = is_int( $ptype_obj->menu_position ) ? $ptype_obj->menu_position : ++$_wp_last_object_menu; // If we're to use $_wp_last_object_menu, increment it first. 120 119 $menu_icon = is_string($ptype_obj->menu_icon) ? esc_url($ptype_obj->menu_icon) : 'div'; 121 120 121 // if $ptype_menu_position is already populated or will be populated by a hard-coded value below, increment the position. 122 $core_menu_positions = array(59, 60, 65, 70, 75, 80, 85, 99); 123 while ( isset($menu[$ptype_menu_position]) || in_array($ptype_menu_position, $core_menu_positions) ) 124 $ptype_menu_position++; 125 122 126 $menu[$ptype_menu_position] = array(esc_attr($ptype_obj->label), $ptype_obj->edit_type_cap, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-posts', 'menu-' . sanitize_html_class($ptype), $menu_icon); 123 127 $submenu["edit.php?post_type=$ptype"][5] = array( __('Edit'), $ptype_obj->edit_type_cap, "edit.php?post_type=$ptype"); … … 412 416 $menu = add_menu_classes($menu); 413 417 414 if ( ! user_can_access_admin_page()) {418 if ( !user_can_access_admin_page() ) { 415 419 do_action('admin_page_access_denied'); 416 420 wp_die( __('You do not have sufficient permissions to access this page.') );
Note: See TracChangeset
for help on using the changeset viewer.