Make WordPress Core

Changeset 12401


Ignore:
Timestamp:
12/15/2009 09:45:29 AM (14 years ago)
Author:
azaozz
Message:

Fix action on dashboard spam link, merge deletecomment with trashcomment, untrashcomment, spamcomment, and unspamcomment, props caesarsgrunt, fixes #11432

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/comment.php

    r12286 r12401  
    138138
    139139case 'deletecomment' :
    140     $comment_id = absint( $_REQUEST['c'] );
    141     check_admin_referer( 'delete-comment_' . $comment_id );
    142 
    143     if ( isset( $_REQUEST['noredir'] ) )
    144         $noredir = true;
    145     else
    146         $noredir = false;
    147 
    148     if ( !$comment = get_comment( $comment_id ) )
    149         comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit-comments.php') );
    150 
    151     if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
    152         comment_footer_die( __('You are not allowed to edit comments on this post.') );
    153 
    154     if ( 'spam' == $_REQUEST['dt'] )
    155         wp_set_comment_status( $comment->comment_ID, 'spam' );
    156     else
    157         wp_delete_comment( $comment->comment_ID );
    158 
    159     if ( '' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php' ) )
    160         wp_redirect( wp_get_referer() );
    161     else if ( '' != wp_get_original_referer() && false == $noredir )
    162         wp_redirect( wp_get_original_referer() );
    163     else
    164         wp_redirect( admin_url('edit-comments.php') );
    165 
    166     die;
    167     break;
    168 
    169140case 'trashcomment' :
    170141case 'untrashcomment' :
     
    191162
    192163    switch ( $action ) {
     164        case 'deletecomment' :
     165            wp_delete_comment($comment_id);
     166            $redir = add_query_arg( array('deleted' => '1'), $redir );
     167            break;
    193168        case 'trashcomment' :
    194169            wp_trash_comment($comment_id);
  • trunk/wp-admin/includes/dashboard.php

    r12311 r12401  
    546546        $approve_url = esc_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" );
    547547        $unapprove_url = esc_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" );
    548         $spam_url = esc_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
     548        $spam_url = esc_url( "comment.php?action=spamcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
    549549        $trash_url = esc_url( "comment.php?action=trashcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
    550550        $delete_url = esc_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
Note: See TracChangeset for help on using the changeset viewer.