WordPress开发者和主题制作者的搜索引擎



edit_bookmark_link ›

Since2.7.0
已弃用n/a
edit_bookmark_link ( $link = '', $before = '', $after = '', $bookmark = null )
参数: (4)
  • (string) $link Optional. Anchor text. Default empty.
    Required: No
    默认: (empty)
  • (string) $before Optional. Display before edit link. Default empty.
    Required: No
    默认: (empty)
  • (string) $after Optional. Display after edit link. Default empty.
    Required: No
    默认: (empty)
  • (int) $bookmark Optional. Bookmark ID. Default is the current bookmark.
    Required: No
    默认: null
定义在:
文档:

Displays the edit bookmark link anchor content.



源码

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