edit_bookmark_link

函数


edit_bookmark_link ( $link = '', $before = '', $after = '', $bookmark = null )
参数
  • (string)
    $link
    Optional. Anchor text. If empty, default is ‘Edit This’. Default empty.
    Required:
    Default: (empty)
  • (string)
    $before
    Optional. Display before edit link. Default empty.
    Required:
    Default: (empty)
  • (string)
    $after
    Optional. Display after edit link. Default empty.
    Required:
    Default: (empty)
  • (int)
    $bookmark
    Optional. Bookmark ID. Default is the current bookmark.
    Required:
    Default: null
定义位置
  • wp-includes/link-template.php
    , line 1682
引入
2.7.0
弃用

显示编辑书签链接锚的内容。

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 = '' . $link . '';

	/**
	 * 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;
}