WordPress: Template Tags/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 WordPress:The Loop, and within a comment lo...) |
无编辑摘要 |
||
(未显示另一用户的1个中间版本) | |||
第1行: | 第1行: | ||
== | == 描述 == | ||
显示一个链接来编辑当前的文章,如果用户已经登录,允许用户编辑评论。必须在[[WordPress:The Loop|The Loop]]内,而且在一个评论loop内。 | |||
== | == 用法 == | ||
%%% <?php edit_comment_link('link', 'before', 'after'); ?> %%% | %%% <?php edit_comment_link('link', 'before', 'after'); ?> %%% | ||
== | == 例子== | ||
== | == 默认用法 == | ||
使用默认设置显示编辑评论链接。 | |||
<?php edit_comment_link(); ?> | |||
=== 在段落标签中显示编辑评论=== | |||
在一个段落(<p>)标签中,显示编辑评论链接,拥有链接文本"编辑评论"。 | |||
<?php edit_comment_link('edit comment', '<p>', '</p>'); ?> | |||
== 参数== | |||
; link : (''string'') 链接文本。默认为<tt>'编辑这个'</tt>。 | |||
; before : (''string'') 链接文本之前放置的文本。没有默认设置。 | |||
; after : (''string'') 链接文本之后放置的文本。没有默认设置。 | |||
== 相关的 == | |||
{{ | {{标签 链接标签}} | ||
{{PHP函数 标签 页底文字}} |
2008年7月16日 (三) 10:52的最新版本
描述[ ]
显示一个链接来编辑当前的文章,如果用户已经登录,允许用户编辑评论。必须在The Loop内,而且在一个评论loop内。
用法[ ]
%%% <?php edit_comment_link('link', 'before', 'after'); ?> %%%
例子[ ]
默认用法[ ]
使用默认设置显示编辑评论链接。
<?php edit_comment_link(); ?>
在段落标签中显示编辑评论[ ]
在一个段落(<p>)标签中,显示编辑评论链接,拥有链接文本"编辑评论"。
<?php edit_comment_link('edit comment', '<p>', '</p>'); ?>
参数[ ]
- link
- (string) 链接文本。默认为'编辑这个'。
- before
- (string) 链接文本之前放置的文本。没有默认设置。
- after
- (string) 链接文本之后放置的文本。没有默认设置。