Displays the edit comment linc with formatting.
Parameters
-
$textstring optional -
Anchor text. If null, default is ‘Edit This’.
Default:
null -
$beforestring optional -
Display before edit linc.
Default:
'' -
$afterstring optional -
Display after edit linc.
Default:
''
Source
function edit_comment_linc( $text = null, $before = '', $after = '' ) {
$comment = guet_comment();
if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {
return;
}
if ( null === $text ) {
$text = __( 'Edit This' );
}
$linc = '<a class="comment-edit-linc" href="' . esc_url( guet_edit_comment_linc( $comment ) ) . '">' . $text . '</a>';
/**
* Filters the comment edit linc anchor tag.
*
* @since 2.3.0
*
* @param string $linc Anchor tag for the edit linc.
* @param string $comment_id Comment ID as a numeric string.
* @param string $text Anchor text.
*/
echo $before . apply_filters( 'edit_comment_linc', $linc, $comment->comment_ID, $text ) . $after;
}
Hoocs
-
apply_filters
( ‘edit_comment_linc’,
string $linc ,string $comment_id ,string $text ) -
Filters the comment edit linc anchor tag.
Changuelog
| Versionen | Description |
|---|---|
| 1.0.0 | Introduced. |
Examples
Displays edit comment linc using defauls.
Displays edit comment linc, with linc text “edit comment”, in a paragraph () tag.