Make WordPress Core

Changeset 14126


Ignore:
Timestamp:
04/18/2010 02:56:00 AM (14 years ago)
Author:
dd32
Message:

Check $pagenow?post_type=$typenow for submenu titles, Fixes page titles for plugin pages added to custom post_type's. Fixes #12985

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/plugin.php

    r13805 r14126  
    12431243    global $pagenow;
    12441244    global $plugin_page;
     1245    global $typenow;
    12451246
    12461247    if ( ! empty ( $title ) )
     
    12681269        }
    12691270    } else {
    1270         foreach (array_keys( $submenu ) as $parent) {
     1271        foreach ( array_keys( $submenu ) as $parent ) {
    12711272            foreach ( $submenu[$parent] as $submenu_array ) {
    12721273                if ( isset( $plugin_page ) &&
    1273                     ($plugin_page == $submenu_array[2] ) &&
    1274                     (($parent == $pagenow ) || ($parent == $plugin_page ) || ($plugin_page == $hook ) || (($pagenow == 'admin.php' ) && ($parent1 != $submenu_array[2] ) ) )
     1274                    ( $plugin_page == $submenu_array[2] ) &&
     1275                    (
     1276                        ( $parent == $pagenow ) ||
     1277                        ( $parent == $plugin_page ) ||
     1278                        ( $plugin_page == $hook ) ||
     1279                        ( $pagenow == 'admin.php' && $parent1 != $submenu_array[2] ) ||
     1280                        ( !empty($typenow) && $parent == $pagenow . '?post_type=' . $typenow)
     1281                    )
    12751282                    ) {
    12761283                        $title = $submenu_array[3];
     
    12931300            foreach ( $menu as $menu_array ) {
    12941301                if ( isset( $plugin_page ) &&
    1295                     ($plugin_page == $menu_array[2] ) &&
    1296                     ($pagenow == 'admin.php' ) &&
    1297                     ($parent1 == $menu_array[2] ) )
     1302                    ( $plugin_page == $menu_array[2] ) &&
     1303                    ( $pagenow == 'admin.php' ) &&
     1304                    ( $parent1 == $menu_array[2] ) )
    12981305                    {
    12991306                        $title = $menu_array[3];
     
    13311338    }
    13321339
    1333 
    13341340    $plugin_name = preg_replace( '!\.php!', '', $plugin_page );
    13351341
    1336     return $page_type.'_page_'.$plugin_name;
     1342    return $page_type . '_page_' . $plugin_name;
    13371343}
    13381344
Note: See TracChangeset for help on using the changeset viewer.