edit_post_link()
edit_post_link( string $text = null, string $before = ”, string $after = ”, int|WP_Post $id, string $class = ‘post-edit-link’ )
显示文章的“编辑文章”链接。
Displays the edit post link for post.
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$text | (string) | 可选 | 锚文本。如果为空,则默认为“编辑此”。 |
$before | (string) | 可选 | 在编辑链接之前显示。 |
$after | (string) | 可选 | 编辑链接后显示。 |
$id | (int | WP_Post) | 可选 | Post ID或Post对象。默认值为全局$post。 |
$class | (string) | 可选 | 将自定义类添加到链接。 |
返回(Return)
无返回值
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
4.4.0 | wp-includes/link-template.php:1413 | 0 | 7 |
笔记(Notes)
显示包装在段落标记中的编辑链接,链接本身带有自定义CSS类。
在段落标记中显示编辑
默认用法
edit_post_link() 为WP2原创文章,链接:https://www.wp2.cn/functions/edit_post_link-2/