Make WordPress Core

Ticket #18785: 18785.8.diff

File 18785.8.diff, 1.0 KB (added by ryan, 14 years ago)

Use set_current_screen() in the wp-fullscreen-save-post ajax handler

  • 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');
    15371531
     1532        set_current_screen( $post_type );
     1533
    15381534        $post_id = edit_post();
    15391535
    15401536        if ( is_wp_error($post_id) ) {