Ticket #4529: 4529-fixes.2.diff
| File 4529-fixes.2.diff, 15.2 KB (added by caesarsgrunt, 3 years ago) |
|---|
-
wp-includes/comment.php
892 892 893 893 do_action('untrash_comment', $comment_id); 894 894 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); 898 896 if ( empty($status) ) 899 897 $status = '0'; 900 898 901 $comment['comment_approved'] = $status; 902 903 if ( wp_update_comment($comment) ) { 899 if ( wp_set_comment_status($comment_id, $status) ) { 904 900 delete_comment_meta($comment_id, '_wp_trash_meta_time'); 905 901 delete_comment_meta($comment_id, '_wp_trash_meta_status'); 906 902 do_action('untrashed_comment', $comment_id); … … 951 947 952 948 do_action('unspam_comment', $comment_id); 953 949 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); 955 951 if ( empty($status) ) 956 952 $status = '0'; 957 953 958 if ( wp_set_comment_status($comment_id, "$status") ) {954 if ( wp_set_comment_status($comment_id, $status) ) { 959 955 delete_comment_meta($comment_id, '_wp_trash_meta_status'); 960 956 do_action('unspammed_comment', $comment_id); 961 957 return true; -
wp-admin/edit-comments.php
313 313 <option value="unspam"><?php _e('Not Spam'); ?></option> 314 314 <?php endif; ?> 315 315 <?php if ( 'trash' == $comment_status || 'spam' == $comment_status || !EMPTY_TRASH_DAYS ): ?> 316 <option value="delete"><?php _e('Delete Permanently'); ?></option>316 <option value="delete"><?php _e('Delete Permanently'); ?></option> 317 317 <?php else: ?> 318 318 <option value="trash"><?php _e('Move to Trash'); ?></option> 319 319 <?php endif; ?> … … 409 409 <option value="untrash"><?php _e('Restore'); ?></option> 410 410 <?php endif; ?> 411 411 <?php if ( 'trash' == $comment_status || 'spam' == $comment_status || !EMPTY_TRASH_DAYS ): ?> 412 <option value="delete"><?php _e('Delete Permanently'); ?></option>412 <option value="delete"><?php _e('Delete Permanently'); ?></option> 413 413 <?php elseif ( 'spam' == $comment_status ): ?> 414 414 <option value="unspam"><?php _e('Not Spam'); ?></option> 415 415 <?php else: ?> -
wp-admin/includes/dashboard.php
555 555 $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\');return false;" class="vim-r hide-if-no-js" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>'; 556 556 $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>'; 557 557 if ( !EMPTY_TRASH_DAYS ) 558 $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';558 $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>'; 559 559 else 560 560 $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . __( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>'; 561 561 -
wp-admin/includes/meta-boxes.php
187 187 if ( ( 'edit' == $action ) && current_user_can("delete_${post_type}", $post->ID) ) { 188 188 if ( !EMPTY_TRASH_DAYS ) { 189 189 $delete_url = wp_nonce_url( add_query_arg( array('action' => 'delete', 'post' => $post->ID) ), "delete-${post_type}_{$post->ID}" ); 190 $delete_text = __('Delete Permanently');190 $delete_text = __('Delete Permanently'); 191 191 } else { 192 192 $delete_url = wp_nonce_url( add_query_arg( array('action' => 'trash', 'post' => $post->ID) ), "trash-${post_type}_{$post->ID}" ); 193 193 $delete_text = __('Move to Trash'); -
wp-admin/includes/template.php
1454 1454 elseif ( EMPTY_TRASH_DAYS ) 1455 1455 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this post to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>"; 1456 1456 if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS ) 1457 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post permanently')) . "' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";1457 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post permanently')) . "' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>"; 1458 1458 } 1459 1459 if ( in_array($post->post_status, array('pending', 'draft')) ) { 1460 1460 if ( current_user_can('edit_post', $post->ID) ) … … 1674 1674 elseif ( EMPTY_TRASH_DAYS ) 1675 1675 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . get_delete_post_link($page->ID) . "'>" . __('Trash') . "</a>"; 1676 1676 if ( $post->post_status == 'trash' || !EMPTY_TRASH_DAYS ) 1677 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>";1677 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>"; 1678 1678 } 1679 1679 if ( in_array($post->post_status, array('pending', 'draft')) ) { 1680 1680 if ( current_user_can('edit_page', $page->ID) ) … … 2189 2189 } 2190 2190 2191 2191 if ( 'spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS ) { 2192 $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::delete=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';2192 $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::delete=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>'; 2193 2193 } else { 2194 2194 $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . __( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>'; 2195 2195 } -
wp-admin/includes/media.php
1223 1223 $send = "<input type='submit' class='button' name='send[$attachment_id]' value='" . esc_attr__( 'Insert into Post' ) . "' />"; 1224 1224 if ( $delete && current_user_can('delete_post', $attachment_id) ) { 1225 1225 if ( !EMPTY_TRASH_DAYS ) 1226 $delete = "<a href=\"" . wp_nonce_url("post.php?action=delete&post=$attachment_id", 'delete-post_' . $attachment_id) . "\" id=\"del[$attachment_id]\" class=\"delete\">" . __('Delete Permanently') . "</a>";1226 $delete = "<a href=\"" . wp_nonce_url("post.php?action=delete&post=$attachment_id", 'delete-post_' . $attachment_id) . "\" id=\"del[$attachment_id]\" class=\"delete\">" . __('Delete Permanently') . "</a>"; 1227 1227 else 1228 1228 $delete = "<a href=\"" . wp_nonce_url("post.php?action=trash&post=$attachment_id", 'trash-post_' . $attachment_id) . "\" id=\"del[$attachment_id]\" class=\"delete\">" . __('Move to Trash') . "</a> <a href=\"" . wp_nonce_url("post.php?action=untrash&post=$attachment_id", 'untrash-post_' . $attachment_id) . "\" id=\"undo[$attachment_id]\" class=\"undo hidden\">" . __('Undo?') . "</a>"; 1229 1229 } else { -
wp-admin/edit-attachment-rows.php
97 97 elseif ( EMPTY_TRASH_DAYS ) 98 98 $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>"; 99 99 if ( $is_trash || !EMPTY_TRASH_DAYS ) 100 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";100 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>"; 101 101 } 102 102 if ( !$is_trash ) 103 103 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; -
wp-admin/upload.php
206 206 $messages[1] = __('Media attachment updated.'); 207 207 $messages[2] = __('Media permanently deleted.'); 208 208 $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>'; 210 210 $messages[5] = __('Media restored from the trash.'); 211 211 212 212 if ( isset($_GET['message']) && (int) $_GET['message'] ) { … … 288 288 <?php if ( $is_trash ) { ?> 289 289 <option value="untrash"><?php _e('Restore'); ?></option> 290 290 <?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?> 291 <option value="delete"><?php _e('Delete Permanently'); ?></option>291 <option value="delete"><?php _e('Delete Permanently'); ?></option> 292 292 <?php } else { ?> 293 293 <option value="trash"><?php _e('Move to Trash'); ?></option> 294 294 <?php } if ( isset($orphans) ) { ?> … … 394 394 if ( EMPTY_TRASH_DAYS ) 395 395 $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>"; 396 396 else 397 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";397 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>"; 398 398 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; 399 399 if ( current_user_can('edit_post', $post->ID) ) 400 400 $actions['attach'] = '<a href="#the-list" onclick="findPosts.open(\'media[]\',\''.$post->ID.'\');return false;" class="hide-if-no-js">'.__('Attach').'</a>'; … … 454 454 <?php if ($is_trash) { ?> 455 455 <option value="untrash"><?php _e('Restore'); ?></option> 456 456 <?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?> 457 <option value="delete"><?php _e('Delete Permanently'); ?></option>457 <option value="delete"><?php _e('Delete Permanently'); ?></option> 458 458 <?php } else { ?> 459 459 <option value="trash"><?php _e('Move to Trash'); ?></option> 460 460 <?php } if (isset($orphans)) { ?> -
wp-admin/edit-form-comment.php
68 68 69 69 <div id="major-publishing-actions"> 70 70 <div id="delete-action"> 71 <?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=" . ( !EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&c=$comment->comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . ( !EMPTY_TRASH_DAYS ? __('Delete Permanently') : __('Move to Trash') ) . "</a>\n"; ?>71 <?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=" . ( !EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&c=$comment->comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . ( !EMPTY_TRASH_DAYS ? __('Delete Permanently') : __('Move to Trash') ) . "</a>\n"; ?> 72 72 </div> 73 73 <div id="publishing-action"> 74 74 <input type="submit" name="save" value="<?php esc_attr_e('Update Comment'); ?>" tabindex="4" class="button-primary" /> -
wp-admin/edit.php
257 257 <?php } else { ?> 258 258 <option value="edit"><?php _e('Edit'); ?></option> 259 259 <?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?> 260 <option value="delete"><?php _e('Delete Permanently'); ?></option>260 <option value="delete"><?php _e('Delete Permanently'); ?></option> 261 261 <?php } else { ?> 262 262 <option value="trash"><?php _e('Move to Trash'); ?></option> 263 263 <?php } ?> … … 347 347 <?php } else { ?> 348 348 <option value="edit"><?php _e('Edit'); ?></option> 349 349 <?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?> 350 <option value="delete"><?php _e('Delete Permanently'); ?></option>350 <option value="delete"><?php _e('Delete Permanently'); ?></option> 351 351 <?php } else { ?> 352 352 <option value="trash"><?php _e('Move to Trash'); ?></option> 353 353 <?php } ?> -
wp-admin/edit-pages.php
261 261 <?php } else { ?> 262 262 <option value="edit"><?php _e('Edit'); ?></option> 263 263 <?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?> 264 <option value="delete"><?php _e('Delete Permanently'); ?></option>264 <option value="delete"><?php _e('Delete Permanently'); ?></option> 265 265 <?php } else { ?> 266 266 <option value="trash"><?php _e('Move to Trash'); ?></option> 267 267 <?php } ?> … … 310 310 <?php } else { ?> 311 311 <option value="edit"><?php _e('Edit'); ?></option> 312 312 <?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?> 313 <option value="delete"><?php _e('Delete Permanently'); ?></option>313 <option value="delete"><?php _e('Delete Permanently'); ?></option> 314 314 <?php } else { ?> 315 315 <option value="trash"><?php _e('Move to Trash'); ?></option> 316 316 <?php } ?>
