Skip to content

Instantly share code, notes, and snippets.

@danielbachhuber
Last active August 29, 2015 13:56
Show Gist options
  • Save danielbachhuber/9123282 to your computer and use it in GitHub Desktop.
Save danielbachhuber/9123282 to your computer and use it in GitHub Desktop.
Show editorial comments on "Edit Comments"
<?php
/**
* Add editorial comments to the Edit Comments list view
*/
add_filter( 'comments_clauses', 'efx_add_editorial_comments' );
function efx_add_editorial_comments( $clauses ) {
global $pagenow;
if ( 'edit-comments.php' != $pagenow ) {
return;
}
$clauses['where'] = str_replace( "( comment_approved = '0' OR comment_approved = '1' )", "( comment_approved = '0' OR comment_approved = '1' OR comment_approved = 'editorial-comment' )", $clauses['where'] );
return $clauses;
}
/**
* Remove the action links from editorial comments in the Edit Comments list view
*/
add_filter( 'comment_row_actions', 'efx_filter_comment_row_actions', 10, 2 );
function efx_filter_comment_row_actions( $actions, $comment ) {
if ( 'editorial-comment' !== $comment->comment_type ) {
return $actions;
}
return array();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment