WP_REST_Users_Controller::prepare_links( WP_Post $user )

Prepares links for the user request.


Description Description


Parameters Parameters

$user

(WP_Post) (Required) User object.


Top ↑

Return Return

(array) Links for the given user.


Top ↑

Source Source

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

	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;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
4.7.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.