WordPress.org

Ready to get started?Download WordPress

Codex

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

zh-cn:Template Tags/edit comment link

概述

一个用户登录成功,且具有编辑留言评论的权限,则通过该函数显示编辑留言评论的链接。 该函数必须在The Loop范围内, 并且在留言评论范围内.

通过get_edit_comment_link 来获取URL.

用法

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

传入参数

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

使用样例

默认用法

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

起源于: 1.0.0

源码文件

edit_comment_link() 函数在源码文件 wp-includes/link-template.php

相关函数

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.