WP_REST_Application_Passwords_Controller::prepare_links
Prepares links for the request.
Method of the class: WP_REST_Application_Passwords_Controller{}
No Hooks.
Returns
Array. The list of links.
Usage
// protected - for code of main (parent) or child class $result = $this->prepare_links( $user, $item );
- $user(WP_User) (required)
- The requested user.
- $item(array) (required)
- The application password.
Changelog
| Since 5.6.0 | Introduced. |
WP_REST_Application_Passwords_Controller::prepare_links() WP REST Application Passwords Controller::prepare links code WP 7.0
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']
)
),
),
);
}