Make WordPress Core


Ignore:
Timestamp:
09/22/2010 12:10:39 AM (14 years ago)
Author:
scribu
Message:

Introduce WP_List_Table::current_action() and use throughout admin list screens. See #14579

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-comments.php

    r15596 r15642  
    1313$wp_list_table->check_permissions();
    1414
    15 if ( isset( $_REQUEST['doaction'] ) ||  isset( $_REQUEST['doaction2'] ) || isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) {
     15$doaction = $wp_list_table->current_action();
     16
     17if ( $doaction ) {
    1618    check_admin_referer( 'bulk-comments' );
    1719
    18     if ( ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) && !empty( $_REQUEST['pagegen_timestamp'] ) ) {
     20    if ( 'delete_all' == $do_action && !empty( $_REQUEST['pagegen_timestamp'] ) ) {
    1921        $comment_status = $wpdb->escape( $_REQUEST['comment_status'] );
    2022        $delete_time = $wpdb->escape( $_REQUEST['pagegen_timestamp'] );
    2123        $comment_ids = $wpdb->get_col( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = '$comment_status' AND '$delete_time' > comment_date_gmt" );
    2224        $doaction = 'delete';
    23     } elseif ( ( $_REQUEST['action'] != -1 || $_REQUEST['action2'] != -1 ) && isset( $_REQUEST['delete_comments'] ) ) {
     25    } elseif ( isset( $_REQUEST['delete_comments'] ) ) {
    2426        $comment_ids = $_REQUEST['delete_comments'];
    2527        $doaction = ( $_REQUEST['action'] != -1 ) ? $_REQUEST['action'] : $_REQUEST['action2'];
    26     } elseif ( $_REQUEST['doaction'] == 'undo' && isset( $_REQUEST['ids'] ) ) {
     28    } elseif ( isset( $_REQUEST['ids'] ) ) {
    2729        $comment_ids = array_map( 'absint', explode( ',', $_REQUEST['ids'] ) );
    28         $doaction = $_REQUEST['action'];
    2930    } else {
    3031        wp_redirect( wp_get_referer() );
Note: See TracChangeset for help on using the changeset viewer.