WordPress.org

Make WordPress Core

Changeset 12290


Ignore:
Timestamp:
11/28/09 03:56:20 (4 years ago)
Author:
azaozz
Message:

"Trash" fixes, props caesarsgrunt, see #4529

Location:
trunk
Files:
2 edited

Legend:

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

    r12284 r12290  
    207207$messages[2] = __('Media permanently deleted.'); 
    208208$messages[3] = __('Error saving media attachment.'); 
    209 $messages[4] = __('Media moved to the trash.') . ' <a href="' . esc_url( wp_nonce_url( 'upload.php?doaction=undo&action=untrash&ids='.$_GET['ids'], "bulk-media" ) ) . '">' . __('Undo?') . '</a>'; 
     209$messages[4] = __('Media moved to the trash.') . ' <a href="' . esc_url( wp_nonce_url( 'upload.php?doaction=undo&action=untrash&ids='.(isset($_GET['ids']) ? $_GET['ids'] : ''), "bulk-media" ) ) . '">' . __('Undo?') . '</a>'; 
    210210$messages[5] = __('Media restored from the trash.'); 
    211211 
  • trunk/wp-includes/comment.php

    r12286 r12290  
    893893    do_action('untrash_comment', $comment_id); 
    894894 
    895     $comment = array('comment_ID' => $comment_id); 
    896  
    897     $status = get_comment_meta($comment_id, '_wp_trash_meta_status', true); 
     895    $status = (string) get_comment_meta($comment_id, '_wp_trash_meta_status', true); 
    898896    if ( empty($status) ) 
    899897        $status = '0'; 
    900898 
    901     $comment['comment_approved'] = $status; 
    902  
    903     if ( wp_update_comment($comment) ) { 
     899    if ( wp_set_comment_status($comment_id, $status) ) { 
    904900        delete_comment_meta($comment_id, '_wp_trash_meta_time'); 
    905901        delete_comment_meta($comment_id, '_wp_trash_meta_status'); 
     
    952948    do_action('unspam_comment', $comment_id); 
    953949 
    954     $status = get_comment_meta($comment_id, '_wp_trash_meta_status', true); 
     950    $status = (string) get_comment_meta($comment_id, '_wp_trash_meta_status', true); 
    955951    if ( empty($status) ) 
    956952        $status = '0'; 
    957953 
    958     if ( wp_set_comment_status($comment_id, "$status") ) { 
     954    if ( wp_set_comment_status($comment_id, $status) ) { 
    959955        delete_comment_meta($comment_id, '_wp_trash_meta_status'); 
    960956        do_action('unspammed_comment', $comment_id); 
Note: See TracChangeset for help on using the changeset viewer.