Make WordPress Core

Ticket #12826: ajax-trash.diff

File ajax-trash.diff, 1.6 KB (added by meheranandk, 15 years ago)

Patch to AJAXify Trash in edit.php (Include admin-ajax.js as well)

  • wp-admin/edit.php

     
    140140$title = sprintf(__('Edit %s'), $post_type_object->label);
    141141
    142142wp_enqueue_script('inline-edit-post');
     143wp_enqueue_script('admin-ajax');
    143144
    144145$user_posts = false;
    145146if ( !current_user_can($post_type_object->edit_others_cap) ) {
  • wp-includes/script-loader.php

     
    166166
    167167        $scripts->add( 'jquery-autocomplete', "/wp-includes/js/jquery/autocomplete$suffix.js", array('jquery'), '1.1' );
    168168        $scripts->add_data( 'jquery-autocomplete', 'group', 1 );
     169       
     170        $scripts->add( 'admin-ajax', "/wp-admin/js/admin-ajax.js", array('jquery'), '20091124' );
    169171
    170172        $scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20100108');
    171173        $scripts->add_data( 'thickbox', 'group', 1 );
  • wp-admin/includes/template.php

     
    13631363                        echo '</div>';
    13641364
    13651365                        get_inline_data($post);
     1366                        echo '<td class="undo-trash" style="display:none;" colspan="6"><b>'.$title.'</b> moved to the trash. <a href="' . esc_url( wp_nonce_url( "edit.php?post_type=post&doaction=undo&action=untrash&ids=".$post->ID, "bulk-posts" ) ) . '">' . __('Undo') . '</a></td>';
     1367
    13661368                ?>
    13671369                </td>
    13681370                <?php