Make WordPress Core

Ticket #19125: 19125.diff

File 19125.diff, 969 bytes (added by nacin, 13 years ago)
  • wp-admin/post-new.php

     
    1616else
    1717        wp_die( __('Invalid post type') );
    1818
    19 if ( 'post' != $post_type ) {
    20         $parent_file = "edit.php?post_type=$post_type";
    21         $submenu_file = "post-new.php?post_type=$post_type";
    22 } else {
     19$post_type_object = get_post_type_object($post_type);
     20
     21if ( 'post' == $post_type ) {
    2322        $parent_file = 'edit.php';
    2423        $submenu_file = 'post-new.php';
     24} else {
     25        if ( isset( $post_type_object ) && $post_type_object->show_in_menu && $post_type_object->show_in_menu !== true )
     26                        $parent_file = $post_type_object->show_in_menu;
     27                else
     28                        $parent_file = "edit.php?post_type=$post_type";
     29                $submenu_file = "post-new.php?post_type=$post_type";
    2530}
    2631
    27 $post_type_object = get_post_type_object($post_type);
    28 
    2932$title = $post_type_object->labels->add_new_item;
    3033
    3134$editing = true;