edit_comment_link()
Outputs a link (HTML tag A) for editing the current comment in the loop, if the user has permission to do so.
This template tag should be used inside the Comments Loop.
Uses: get_edit_comment_link()
Hooks from the function
Returns
null. Outputs the HTML code for the link.
Usage
<?php edit_comment_link( $link, $before, $after ); ?>
- $link(string)
- Text of the link.
Default: null — __('Edit This') - $before(string)
- Text before the link. HTML code can be used.
Default: '' - $after(string)
- Text after the link.
Default: ''
Examples
#1 Display a link to edit a comment
Use this code in the comments loop (comments.php file):
<?php edit_comment_link(); ?>
#2 Change the text of the link and put the link in the html tag <p>:
<?php edit_comment_link( 'edit comment', '<p>', '</p>' ); ?>
Changelog
| Since 1.0.0 | Introduced. |