get_link_to_edit() WordPress Function

The get_link_to_edit() function in WordPress allows you to easily get the link to edit a post or page. This function is useful for creating links to edit content in your theme or plugin.

get_link_to_edit( int|stdClass $link ) #

Retrieves link data based on its ID.


Parameters

$link

(int|stdClass)(Required)Link ID or object to retrieve.


Top ↑

Return

(object) Link object for editing.


Top ↑

Source

File: wp-admin/includes/bookmark.php

function get_link_to_edit( $link ) {
	return get_bookmark( $link, OBJECT, 'edit' );
}


Top ↑

Changelog

Changelog
VersionDescription
2.0.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.