WordPress.org

Make WordPress Core

Ticket #12992: menu.diff

File menu.diff, 1.7 KB (added by wmrom, 5 years ago)

Diff file showing changes

  • wp-admin/menu.php

     
    117117       $ptype_obj = get_post_type_object($ptype); 
    118118       $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. 
    119119       $menu_icon = is_string($ptype_obj->menu_icon) ? esc_url($ptype_obj->menu_icon) : 'div'; 
     120       $menu_icon_class = $menu_icon == 'div' ? 'posts' : sanitize_html_class($ptype); 
    120121 
    121122       // if $ptype_menu_position is already populated or will be populated by a hard-coded value below, increment the position. 
    122123       $core_menu_positions = array(59, 60, 65, 70, 75, 80, 85, 99); 
    123124       while ( isset($menu[$ptype_menu_position]) || in_array($ptype_menu_position, $core_menu_positions) ) 
    124125               $ptype_menu_position++; 
    125126 
    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); 
     127       $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_icon_class, 'menu-' . sanitize_html_class($ptype), $menu_icon); 
    127128       $submenu["edit.php?post_type=$ptype"][5]  = array( __('Edit'), $ptype_obj->edit_type_cap,  "edit.php?post_type=$ptype"); 
    128129       /* translators: add new custom post type */ 
    129130       $submenu["edit.php?post_type=$ptype"][10]  = array( _x('Add New', 'post'), $ptype_obj->edit_type_cap, "post-new.php?post_type=$ptype" );