edit_comment_link

Definition:
function edit_comment_link( $link = null, $before = '', $after = '' ) {}

Display or retrieve edit comment link with formatting.

Parameters

  • string $link: Optional. Anchor text.
  • string $before: Optional. Display before edit link.
  • string $after: Optional. Display after edit link.

Return values

returns:HTML content, if $echo is set to false.

Defined filters

  • edit_comment_link
    apply_filters( 'edit_comment_link', $link, $comment->comment_ID )

Source code

function edit_comment_link( $link = null, $before = '', $after = '' ) {

	global $comment;



	if ( !current_user_can( 'edit_comment', $comment->comment_ID ) )

		return;



	if ( null === $link )

		$link = __('Edit This');



	$link = '<a class="comment-edit-link" href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . esc_attr__( 'Edit comment' ) . '">' . $link . '</a>';

	echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after;

}

998

No comments yet... Be the first to leave a reply!

Leave a comment