Make WordPress Core

Ticket #13876: 13876.diff

File 13876.diff, 1.6 KB (added by duck_, 15 years ago)
  • wp-admin/includes/template.php

     
    33163316 * @since unknown
    33173317 */
    33183318function favorite_actions( $screen = null ) {
    3319         global $post_type_object;
     3319        global $post_type_object, $hook_suffix;
    33203320
    33213321        $default_action = false;
    33223322
     
    33243324                $screen = convert_to_screen($screen);
    33253325
    33263326        if ( isset($post_type_object) ) {
    3327                 switch ( $screen->id ) {
    3328                         case $post_type_object->name:
    3329                                 $default_action = array('edit.php?post_type=' . $post_type_object->name => array($post_type_object->labels->edit_item, $post_type_object->cap->edit_posts));
    3330                                 break;
    3331                         case "edit-{$post_type_object->name}":
    3332                                 $default_action = array('post-new.php?post_type=' . $post_type_object->name => array($post_type_object->labels->new_item, $post_type_object->cap->edit_posts));
    3333                                 break;
    3334                 }
     3327                if ( "edit-{$post_type_object->name}" == $screen->id || 'post.php' == $hook_suffix )
     3328                        $default_action = array('post-new.php?post_type=' . $post_type_object->name => array($post_type_object->labels->new_item, $post_type_object->cap->edit_posts));
     3329                elseif ( $post_type_object->name == $screen->id )
     3330                        $default_action = array('edit.php?post_type=' . $post_type_object->name => array($post_type_object->labels->edit_item, $post_type_object->cap->edit_posts));
    33353331        }
    33363332
    3337         if ( !$default_action ) {
     3333        if ( ! $default_action ) {
    33383334                switch ( $screen->id ) {
    33393335                        case 'upload':
    33403336                                $default_action = array('media-new.php' => array(__('New Media'), 'upload_files'));