Make WordPress Core

Ticket #34045: 34041.01.patch

File 34041.01.patch, 2.2 KB (added by johnjamesjacoby, 11 years ago)

First pass fix. Not confident in the approach, but it solves the problem.

  • src/wp-admin/menu.php

    diff --git a/src/wp-admin/menu.php b/src/wp-admin/menu.php
    index 46b69cd..8672380 100644
    a b  
    102102        if ( 'post' === $ptype ) {
    103103                $menu_class .= ' open-if-no-js';
    104104                $ptype_file = "edit.php";
    105                 $post_new_file = "post-new.php";
     105                $_post_new_file = "post-new.php";
    106106                $edit_tags_file = "edit-tags.php?taxonomy=%s";
    107107        } else {
    108108                $ptype_file = "edit.php?post_type=$ptype";
    109                 $post_new_file = "post-new.php?post_type=$ptype";
     109                $_post_new_file = "post-new.php?post_type=$ptype";
    110110                $edit_tags_file = "edit-tags.php?taxonomy=%s&post_type=$ptype";
    111111        }
    112112
     
    125125
    126126        $menu[$ptype_menu_position] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap->edit_posts, $ptype_file, '', $menu_class, $ptype_menu_id, $menu_icon );
    127127        $submenu[ $ptype_file ][5]  = array( $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts,  $ptype_file );
    128         $submenu[ $ptype_file ][10]  = array( $ptype_obj->labels->add_new, $ptype_obj->cap->create_posts, $post_new_file );
     128        $submenu[ $ptype_file ][10]  = array( $ptype_obj->labels->add_new, $ptype_obj->cap->create_posts, $_post_new_file );
    129129
    130130        $i = 15;
    131131        foreach ( get_taxonomies( array(), 'objects' ) as $tax ) {
     
    135135                $submenu[ $ptype_file ][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, sprintf( $edit_tags_file, $tax->name ) );
    136136        }
    137137}
    138 unset($ptype, $ptype_obj, $ptype_for_id, $ptype_menu_position, $menu_icon, $i, $tax);
     138unset($ptype, $ptype_obj, $ptype_for_id, $ptype_menu_position, $menu_icon, $i, $tax, $_post_new_file);
    139139
    140140$menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' );
    141141
  • src/wp-admin/post-new.php

    diff --git a/src/wp-admin/post-new.php b/src/wp-admin/post-new.php
    index 0c84608..d20e986 100644
    a b  
    2828if ( 'post' == $post_type ) {
    2929        $parent_file = 'edit.php';
    3030        $submenu_file = 'post-new.php';
     31        $post_new_file = $submenu_file;
    3132} elseif ( 'attachment' == $post_type ) {
    3233        if ( wp_redirect( admin_url( 'media-new.php' ) ) )
    3334                exit;
     
    4546                                $submenu_file = $parent_file;
    4647                        }
    4748                }
     49                $post_new_file = $submenu_file;
    4850        } else {
    4951                $parent_file = "edit.php?post_type=$post_type";
     52                $post_new_file = $parent_file;
    5053        }
    5154}
    5255