222 foreach ( $comment_types as $type => $label ) |
224 foreach ( $comment_types as $type => $label ) |
223 echo "\t<option value='" . esc_attr( $type ) . "'" . selected( $comment_type, $type, false ) . ">$label</option>\n"; |
225 echo "\t<option value='" . esc_attr( $type ) . "'" . selected( $comment_type, $type, false ) . ">$label</option>\n"; |
224 ?> |
226 ?> |
225 </select> |
227 </select> |
226 <?php |
228 <?php |
227 submit_button( __( 'Filter' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) ); |
229 do_action( 'restrict_manage_comments' ); |
|
230 submit_button( __( 'Filter' ), 'button', false, false, array( 'id' => 'post-query-submit' ) ); |
228 } |
231 } |
229 |
232 |
230 if ( ( 'spam' == $comment_status || 'trash' == $comment_status ) && current_user_can( 'moderate_comments' ) ) { |
233 if ( ( 'spam' == $comment_status || 'trash' == $comment_status ) && current_user_can( 'moderate_comments' ) ) { |
231 wp_nonce_field( 'bulk-destroy', '_destroy_nonce' ); |
234 wp_nonce_field( 'bulk-destroy', '_destroy_nonce' ); |
232 $title = ( 'spam' == $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' ); |
235 $title = ( 'spam' == $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' ); |
233 submit_button( $title, 'button-secondary apply', 'delete_all', false ); |
236 submit_button( $title, 'apply', 'delete_all', false ); |
234 } |
237 } |
235 do_action( 'manage_comments_nav', $comment_status ); |
238 do_action( 'manage_comments_nav', $comment_status ); |
236 echo '</div>'; |
239 echo '</div>'; |
237 } |
240 } |
238 |
241 |
315 echo $this->single_row_columns( $comment ); |
318 echo $this->single_row_columns( $comment ); |
316 echo "</tr>\n"; |
319 echo "</tr>\n"; |
317 } |
320 } |
318 |
321 |
319 function column_cb( $comment ) { |
322 function column_cb( $comment ) { |
320 if ( $this->user_can ) |
323 if ( $this->user_can ) { ?> |
321 echo "<input type='checkbox' name='delete_comments[]' value='$comment->comment_ID' />"; |
324 <label class="screen-reader-text" for="cb-select-<?php echo $comment->comment_ID; ?>"><?php _e( 'Select comment' ); ?></label> |
|
325 <input id="cb-select-<?php echo $comment->comment_ID; ?>" type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /> |
|
326 <?php |
|
327 } |
322 } |
328 } |
323 |
329 |
324 function column_comment( $comment ) { |
330 function column_comment( $comment ) { |
325 global $post, $comment_status; |
331 global $comment_status; |
|
332 $post = get_post(); |
326 |
333 |
327 $user_can = $this->user_can; |
334 $user_can = $this->user_can; |
328 |
335 |
329 $comment_url = esc_url( get_comment_link( $comment->comment_ID ) ); |
336 $comment_url = esc_url( get_comment_link( $comment->comment_ID ) ); |
330 $the_comment_status = wp_get_comment_status( $comment->comment_ID ); |
337 $the_comment_status = wp_get_comment_status( $comment->comment_ID ); |
331 |
338 |
332 $ptime = date( 'G', strtotime( $comment->comment_date ) ); |
339 $ptime = date( 'G', strtotime( $comment->comment_date ) ); |
333 if ( ( abs( time() - $ptime ) ) < 86400 ) |
340 if ( ( abs( time() - $ptime ) ) < DAY_IN_SECONDS ) |
334 $ptime = sprintf( __( '%s ago' ), human_time_diff( $ptime ) ); |
341 $ptime = sprintf( __( '%s ago' ), human_time_diff( $ptime ) ); |
335 else |
342 else |
336 $ptime = mysql2date( __( 'Y/m/d \a\t g:i A' ), $comment->comment_date ); |
343 $ptime = mysql2date( __( 'Y/m/d \a\t g:i A' ), $comment->comment_date ); |
337 |
344 |
338 if ( $user_can ) { |
345 if ( $user_can ) { |
387 'trash' => '', 'untrash' => '', 'delete' => '' |
394 'trash' => '', 'untrash' => '', 'delete' => '' |
388 ); |
395 ); |
389 |
396 |
390 if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments |
397 if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments |
391 if ( 'approved' == $the_comment_status ) |
398 if ( 'approved' == $the_comment_status ) |
392 $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; |
399 $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved' class='vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; |
393 else if ( 'unapproved' == $the_comment_status ) |
400 else if ( 'unapproved' == $the_comment_status ) |
394 $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; |
401 $actions['approve'] = "<a href='$approve_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved' class='vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; |
395 } else { |
402 } else { |
396 $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; |
403 $actions['approve'] = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; |
397 $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; |
404 $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' class='vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; |
398 } |
405 } |
399 |
406 |
400 if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) { |
407 if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) { |
401 $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>'; |
408 $actions['spam'] = "<a href='$spam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::spam=1' class='vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>'; |
402 } elseif ( 'spam' == $the_comment_status ) { |
409 } elseif ( 'spam' == $the_comment_status ) { |
403 $actions['unspam'] = "<a href='$unspam_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1 vim-z vim-destructive'>" . _x( 'Not Spam', 'comment' ) . '</a>'; |
410 $actions['unspam'] = "<a href='$unspam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1' class='vim-z vim-destructive'>" . _x( 'Not Spam', 'comment' ) . '</a>'; |
404 } elseif ( 'trash' == $the_comment_status ) { |
411 } elseif ( 'trash' == $the_comment_status ) { |
405 $actions['untrash'] = "<a href='$untrash_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1 vim-z vim-destructive'>" . __( 'Restore' ) . '</a>'; |
412 $actions['untrash'] = "<a href='$untrash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1' class='vim-z vim-destructive'>" . __( 'Restore' ) . '</a>'; |
406 } |
413 } |
407 |
414 |
408 if ( 'spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS ) { |
415 if ( 'spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS ) { |
409 $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>'; |
416 $actions['delete'] = "<a href='$delete_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::delete=1' class='delete vim-d vim-destructive'>" . __( 'Delete Permanently' ) . '</a>'; |
410 } else { |
417 } else { |
411 $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x( 'Trash', 'verb' ) . '</a>'; |
418 $actions['trash'] = "<a href='$trash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::trash=1' class='delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x( 'Trash', 'verb' ) . '</a>'; |
412 } |
419 } |
413 |
420 |
414 if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) { |
421 if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) { |
415 $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . esc_attr__( 'Edit comment' ) . "'>". __( 'Edit' ) . '</a>'; |
422 $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . esc_attr__( 'Edit comment' ) . "'>". __( 'Edit' ) . '</a>'; |
416 $actions['quickedit'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\' );return false;" class="vim-q" title="'.esc_attr__( 'Quick Edit' ).'" href="#">' . __( 'Quick Edit' ) . '</a>'; |
423 $actions['quickedit'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\' );return false;" class="vim-q" title="'.esc_attr__( 'Quick Edit' ).'" href="#">' . __( 'Quick Edit' ) . '</a>'; |