Make WordPress Core


Ignore:
Timestamp:
03/11/2010 05:05:16 PM (15 years ago)
Author:
ryan
Message:

Allow custom post types to have custom icons. Props ptahdunbar, Denis-de-Bernardy. fixes #12434

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/menu.php

    r13645 r13660  
    2828if ( is_multisite() && is_super_admin() ) {
    2929    /* translators: Network menu item */
    30     $menu[0] = array(__('Super Admin'), 'manage_network', 'ms-admin.php', '', 'menu-top menu-top-first', 'menu-site', 'div');
     30    $menu[0] = array(__('Super Admin'), 'manage_network', 'ms-admin.php', '', 'menu-top menu-top-first menu-icon-site', 'menu-site', 'div');
    3131    $submenu[ 'ms-admin.php' ][1] = array( __('Admin'), 'manage_network', 'ms-admin.php' );
    3232    /* translators: Sites menu item */
     
    3939    $menu[1] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
    4040
    41     $menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top', 'menu-dashboard', 'div' );
     41    $menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top menu-icon-dashboard', 'menu-dashboard', 'div' );
    4242} else {
    43     $menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top menu-top-first', 'menu-dashboard', 'div' );
     43    $menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'div' );
    4444}
    4545
     
    8080$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
    8181
    82 $menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu-top', 'menu-posts', 'div' );
     82$menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu-top menu-icon-posts', 'menu-posts', 'div' );
    8383    $submenu['edit.php'][5]  = array( __('Edit'), 'edit_posts', 'edit.php' );
    8484    /* translators: add new post */
     
    9494    unset($tax);
    9595
    96 $menu[10] = array( __('Media'), 'upload_files', 'upload.php', '', 'menu-top', 'menu-media', 'div' );
     96$menu[10] = array( __('Media'), 'upload_files', 'upload.php', '', 'menu-top menu-icon-media', 'menu-media', 'div' );
    9797    $submenu['upload.php'][5] = array( __('Library'), 'upload_files', 'upload.php');
    9898    /* translators: add new file */
    9999    $submenu['upload.php'][10] = array( _x('Add New', 'file'), 'upload_files', 'media-new.php');
    100100
    101 $menu[15] = array( __('Links'), 'manage_links', 'link-manager.php', '', 'menu-top', 'menu-links', 'div' );
     101$menu[15] = array( __('Links'), 'manage_links', 'link-manager.php', '', 'menu-top menu-icon-links', 'menu-links', 'div' );
    102102    $submenu['link-manager.php'][5] = array( __('Edit'), 'manage_links', 'link-manager.php' );
    103103    /* translators: add new links */
     
    105105    $submenu['link-manager.php'][15] = array( __('Link Categories'), 'manage_categories', 'edit-link-categories.php' );
    106106
    107 $menu[20] = array( __('Pages'), 'edit_pages', 'edit.php?post_type=page', '', 'menu-top', 'menu-pages', 'div' );
     107$menu[20] = array( __('Pages'), 'edit_pages', 'edit.php?post_type=page', '', 'menu-top menu-icon-pages', 'menu-pages', 'div' );
    108108    $submenu['edit.php?post_type=page'][5] = array( __('Edit'), 'edit_pages', 'edit.php?post_type=page' );
    109109    /* translators: add new page */
    110110    $submenu['edit.php?post_type=page'][10] = array( _x('Add New', 'page'), 'edit_pages', 'post-new.php?post_type=page' );
    111111
    112 $menu[25] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php', '', 'menu-top', 'menu-comments', 'div' );
     112$menu[25] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php', '', 'menu-top menu-icon-comments', 'menu-comments', 'div' );
    113113
    114114$_wp_last_object_menu = 25; // The index of the last top-level menu in the object menu group
     
    117117    $_wp_last_object_menu++;
    118118    $ptype_obj = get_post_type_object($ptype);
    119     $menu[$_wp_last_object_menu] = array(esc_attr($ptype_obj->label), $ptype_obj->edit_type_cap, "edit.php?post_type=$ptype", '', 'menu-top', 'menu-posts', 'div');
     119   
     120    $menu[$_wp_last_object_menu] = 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), 'div');
    120121    $submenu["edit.php?post_type=$ptype"][5]  = array( __('Edit'), 'edit_posts',  "edit.php?post_type=$ptype");
    121122    /* translators: add new custom post type */
     
    134135$menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' );
    135136
    136 $menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top', 'menu-appearance', 'div' );
     137$menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' );
    137138    $submenu['themes.php'][5]  = array(__('Themes'), 'switch_themes', 'themes.php');
    138139    $submenu['themes.php'][10] = array(__('Menus'), 'switch_themes', 'nav-menus.php');
     
    152153$menu_perms = get_site_option('menu_items', array());
    153154if ( is_super_admin() || ( is_multisite() && isset($menu_perms['plugins']) && $menu_perms['plugins'] ) ) {
    154     $menu[65] = array( sprintf( __('Plugins %s'), "<span class='update-plugins count-$update_count'><span class='plugin-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'activate_plugins', 'plugins.php', '', 'menu-top', 'menu-plugins', 'div' );
     155    $menu[65] = array( sprintf( __('Plugins %s'), "<span class='update-plugins count-$update_count'><span class='plugin-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'activate_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'div' );
    155156        $submenu['plugins.php'][5]  = array( __('Installed'), 'activate_plugins', 'plugins.php' );
    156157        /* translators: add new plugin */
     
    161162
    162163if ( current_user_can('edit_users') )
    163     $menu[70] = array( __('Users'), 'edit_users', 'users.php', '', 'menu-top', 'menu-users', 'div' );
     164    $menu[70] = array( __('Users'), 'edit_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'div' );
    164165else
    165     $menu[70] = array( __('Profile'), 'read', 'profile.php', '', 'menu-top', 'menu-users', 'div' );
     166    $menu[70] = array( __('Profile'), 'read', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'div' );
    166167
    167168if ( current_user_can('edit_users') ) {
     
    176177}
    177178
    178 $menu[75] = array( __('Tools'), 'read', 'tools.php', '', 'menu-top', 'menu-tools', 'div' );
     179$menu[75] = array( __('Tools'), 'read', 'tools.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'div' );
    179180    $submenu['tools.php'][5] = array( __('Tools'), 'read', 'tools.php' );
    180181    $submenu['tools.php'][10] = array( __('Import'), 'import', 'import.php' );
     
    185186        $submenu['tools.php'][50] = array(__('Network'), 'manage_options', 'network.php');
    186187
    187 $menu[80] = array( __('Settings'), 'manage_options', 'options-general.php', '', 'menu-top', 'menu-settings', 'div' );
     188$menu[80] = array( __('Settings'), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'div' );
    188189    $submenu['options-general.php'][10] = array(_x('General', 'settings screen'), 'manage_options', 'options-general.php');
    189190    $submenu['options-general.php'][15] = array(__('Writing'), 'manage_options', 'options-writing.php');
Note: See TracChangeset for help on using the changeset viewer.