Last active
August 29, 2015 13:56
-
-
Save danielbachhuber/9123282 to your computer and use it in GitHub Desktop.
Show editorial comments on "Edit Comments"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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