Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
* Print a View Comment link in the comments list in the admin.
*
* @param array $actions
* @return array
*/
function custom_view_comment_action( $actions ) {
global $comment;
if ( $comment->comment_type !== '' ) {
return $actions;
}
$actions['view_comment'] = '<a href="' . get_comment_link( $comment ) . '" title="View Comment" target="_blank">View Comment</a>';
return $actions;
}
add_filter( 'comment_row_actions', 'custom_view_comment_action' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment