get_default_link_to_edit() WordPress Function

The get_default_link_to_edit() function is used to get the default link to edit for a given post type. This function will return the edit link for the first post type with the capability to edit_posts.

get_default_link_to_edit() #

Retrieves the default link for editing.


Return

(stdClass) Default link object.


Top ↑

Source

File: wp-admin/includes/bookmark.php

function get_default_link_to_edit() {
	$link = new stdClass;
	if ( isset( $_GET['linkurl'] ) ) {
		$link->link_url = esc_url( wp_unslash( $_GET['linkurl'] ) );
	} else {
		$link->link_url = '';
	}

	if ( isset( $_GET['name'] ) ) {
		$link->link_name = esc_attr( wp_unslash( $_GET['name'] ) );
	} else {
		$link->link_name = '';
	}

	$link->link_visible = 'Y';

	return $link;
}


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.