WP_REST_Users_Controller::prepare_links() – Prepares links for the user request.

You appear to be a bot. Output may be restricted

Description

Prepares links for the user request.

Usage

$array = WP_REST_Users_Controller::prepare_links( $user );

Parameters

$user
( WP_User ) required – User object.

Returns

array Links for the given user.

Source

File name: wordpress/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
Lines:

1 to 12 of 12
  protected function prepare_links( $user ) {
    $links = array(
      'self'       => array(
        'href' => rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $user->ID ) ),
      ),
      'collection' => array(
        'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),
      ),
    );

    return $links;
  }
 

 View on GitHub View on Trac