Skip to content

Instantly share code, notes, and snippets.

@SiR-DanieL
Created December 16, 2016 13:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SiR-DanieL/4ae2d0a09d655d2f99e51cd5d3e86cd2 to your computer and use it in GitHub Desktop.
Save SiR-DanieL/4ae2d0a09d655d2f99e51cd5d3e86cd2 to your computer and use it in GitHub Desktop.
/**
* 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