WP_REST_Application_Passwords_Controller::prepare_links() WordPress Method

The prepare_links() method is used to prepare the links for the WP_REST_Application_Passwords_Controller::register_routes() method. This method adds the self, collection, and profile links for the application passwords route.

WP_REST_Application_Passwords_Controller::prepare_links( WP_User $user, array $item ) #

Prepares links for the request.


Parameters

$user

(WP_User)(Required)The requested user.

$item

(array)(Required)The application password.


Top ↑

Return

(array) The list of links.


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php

	protected function prepare_links( WP_User $user, $item ) {
		return array(
			'self' => array(
				'href' => rest_url( sprintf( '%s/users/%d/application-passwords/%s', $this->namespace, $user->ID, $item['uuid'] ) ),
			),
		);
	}


Top ↑

Changelog

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