函数原型
edit_bookmark_link( string $link = ”, string $before = ”, string $after = ”, int $bookmark = null )
函数描述
Displays the edit bookmark link anchor content.
是否弃用
未弃用
函数参数
-
$link
string
Optional - Anchor text. If empty, default is ‘Edit This’.
Default:
'' -
$before
string
Optional - Display before edit link.
Default:
'' -
$after
string
Optional - Display after edit link.
Default:
'' -
$bookmark
int
Optional - Bookmark ID. Default is the current bookmark.
Default:
null
函数返回值
无
函数位置
File: wp-includes/link-template.php.
函数源码
function edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) {
$bookmark = get_bookmark( $bookmark );
if ( ! current_user_can( 'manage_links' ) ) {
return;
}
if ( empty( $link ) ) {
$link = __( 'Edit This' );
}
$link = '<a href="' . esc_url( get_edit_bookmark_link( $bookmark ) ) . '">' . $link . '</a>';
/**
* Filters the bookmark edit link anchor tag.
*
* @since 2.7.0
*
* @param string $link Anchor tag for the edit link.
* @param int $link_id Bookmark ID.
*/
echo $before . apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id ) . $after;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.7.0 | Introduced. |

