WordPress at a glance

edit_comment_link() WP 1.0

Displays the edit comment link with formatting.

Works based on: get_edit_comment_link()
Hooks from function:
Return

Nothing (null).

Usage

edit_comment_link( $text, $before, $after );
$text(string)
Anchor text. If null. Default null.
Default: 'Edit This'
$before(string)
Display before edit link.
Default: ''
$after(string)
Display after edit link.
Default: ''

Code of edit_comment_link: wp-includes/link-template.php VER 4.9.8

<?php
function edit_comment_link( $text = null, $before = '', $after = '' ) {
	$comment = get_comment();

	if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {
		return;
	}

	if ( null === $text ) {
		$text = __( 'Edit This' );
	}

	$link = '<a class="comment-edit-link" href="' . esc_url( get_edit_comment_link( $comment ) ) . '">' . $text . '</a>';

	/**
	 * Filters the comment edit link anchor tag.
	 *
	 * @since 2.3.0
	 *
	 * @param string $link       Anchor tag for the edit link.
	 * @param int    $comment_id Comment ID.
	 * @param string $text       Anchor text.
	 */
	echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID, $text ) . $after;
}

Related Functions

From tag: edit_

More from tag: permalinks (clean friendly URL)

More from category: Comments Loop

More from Template Tags: Links (URL)

No comments
    Hello, !     Log In . Register