WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/edit comment link

Description

Displays a link to edit the current comment, if the user is logged in and allowed to edit the comment. It must be within The Loop, and within a comment loop.

Use get_edit_comment_link to retrieve the url.

Usage

 <?php edit_comment_link$link$before$after ); ?> 

Parameters

link
(string) (optional) The link text.
Default: __('Edit This')
before
(string) (optional) Text to put before the link text.
Default: None
after
(string) (optional) Text to put after the link text.
Default: None

Examples

Default Usage

Displays edit comment link using defaults.

<?php edit_comment_link(); ?>

Displays Edit Comment in Paragraph Tag

Displays edit comment link, with link text "edit comment", in a paragraph (<p>) tag.

<?php edit_comment_link(__('edit comment'), '<p>', '</p>'); ?>

Filters

apply_filters() Calls 'edit_comment_link' hook on the author email

Changelog

Since: 1.0.0

Source File

edit_comment_link() is located in wp-includes/link-template.php

Related

Edit Link: edit_post_link(), edit_comment_link(), edit_tag_link(), edit_bookmark_link()

See also index of Function Reference and index of Template Tags.