Make WordPress Core

Ticket #18785: 18785.9.diff

File 18785.9.diff, 933 bytes (added by ryan, 13 years ago)

Remove screen setup

  • wp-admin/admin-ajax.php

     
    15181518                $post = get_post($post_id);
    15191519                if ( $post ) {
    15201520                        $post_type_object = get_post_type_object($post->post_type);
    1521                         if ( $post_type_object ) {
     1521                        if ( $post_type_object )
    15221522                                $post_type = $post->post_type;
    1523                                 $current_screen->post_type = $post->post_type;
    1524                                 $current_screen->id = $current_screen->post_type;
    1525                         }
    15261523                }
    15271524        } elseif ( isset($_POST['post_type']) ) {
    15281525                $post_type_object = get_post_type_object($_POST['post_type']);
    1529                 if ( $post_type_object ) {
     1526                if ( $post_type_object )
    15301527                        $post_type = $post_type_object->name;
    1531                         $current_screen->post_type = $post_type;
    1532                         $current_screen->id = $current_screen->post_type;
    1533                 }
    15341528        }
    15351529
    15361530        check_ajax_referer('update-' . $post_type . '_' . $post_id, '_wpnonce');