get_edit_bookmark_link() WordPress Function

The get_edit_bookmark_link() function is used to retrieve the edit bookmark link for a given bookmarked post. This function is useful for displaying a link to the edit bookmark page in the front-end of a site.

get_edit_bookmark_link( int|stdClass $link ) #

Displays the edit bookmark link.


Parameters

$link

(int|stdClass)(Optional) Bookmark ID. Default is the ID of the current bookmark.


Top ↑

Return

(string|void) The edit bookmark link URL.


Top ↑

Source

File: wp-includes/link-template.php

function get_edit_bookmark_link( $link = 0 ) {
	$link = get_bookmark( $link );

	if ( ! current_user_can( 'manage_links' ) ) {
		return;
	}

	$location = admin_url( 'link.php?action=edit&link_id=' ) . $link->link_id;

	/**
	 * Filters the bookmark edit link.
	 *
	 * @since 2.7.0
	 *
	 * @param string $location The edit link.
	 * @param int    $link_id  Bookmark ID.
	 */
	return apply_filters( 'get_edit_bookmark_link', $location, $link->link_id );
}


Top ↑

Changelog

Changelog
VersionDescription
2.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More