WordPress.org

Make WordPress Core

Changeset 19425


Ignore:
Timestamp:
11/23/2011 08:45:23 PM (7 years ago)
Author:
nacin
Message:

Select the submenu item for post-new.php when using show_in_menu = 'some-parent-file' for post types. Continue to select the post-new.php submenu item if it has been separately added with add_submenu_page(). fixes #19125.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/post-new.php

    r19374 r19425  
    2323    $submenu_file = 'post-new.php';
    2424} else {
    25     if ( isset( $post_type_object ) && $post_type_object->show_in_menu && $post_type_object->show_in_menu !== true )
     25    $submenu_file = "post-new.php?post_type=$post_type";
     26    if ( isset( $post_type_object ) && $post_type_object->show_in_menu && $post_type_object->show_in_menu !== true ) {
    2627        $parent_file = $post_type_object->show_in_menu;
    27     else
     28        if ( ! isset( $_registered_pages[ get_plugin_page_hookname( "post-new.php?post_type=$post_type", $post_type_object->show_in_menu ) ] ) )
     29            $submenu_file = $parent_file;
     30    } else {
    2831        $parent_file = "edit.php?post_type=$post_type";
    29     $submenu_file = "post-new.php?post_type=$post_type";
     32    }
    3033}
    3134
Note: See TracChangeset for help on using the changeset viewer.