WordPress.org

Make WordPress Core

Changeset 11032


Ignore:
Timestamp:
04/21/09 19:49:56 (6 years ago)
Author:
ryan
Message:

Hook name back-compat from Denis-de-Bernardy. fixes #9438

File:
1 edited

Legend:

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

    r11017 r11032  
    128128// Create list of page plugin hook names. 
    129129foreach ($menu as $menu_page) { 
    130     $admin_page_hooks[$menu_page[2]] = sanitize_title(basename($menu_page[2], '.php')); 
     130    $hook_name = sanitize_title(basename($menu_page[2], '.php')); 
     131     
     132    // ensure we're backwards compatible 
     133    $compat = array( 
     134        'index' => 'dashboard', 
     135        'edit' => 'posts', 
     136        'upload' => 'media', 
     137        'link-manager' => 'links', 
     138        'edit-pages' => 'pages', 
     139        'edit-comments' => 'comments', 
     140        'options-general' => 'settings', 
     141        ); 
     142     
     143    if ( isset($compat[$hook_name]) ) 
     144        $hook_name = $compat[$hook_name]; 
     145    elseif ( !$hook_name ) 
     146        continue; 
     147     
     148    $admin_page_hooks[$menu_page[2]] = $hook_name; 
    131149} 
    132150 
Note: See TracChangeset for help on using the changeset viewer.