WordPress at a glance
function is not described

WP_REST_Plugins_Controller::prepare_links() protected WP 5.5.0

Prepares links for the request.

{} It's a method of the class: WP_REST_Plugins_Controller{}

No Hooks.

Return

Array[].

Usage

// protected - for code of main (parent) or child class
$result = $this->prepare_links( $item );
$item(array) (required)
The plugin item.

Changelog

Since 5.5.0 Introduced.

Code of WP_REST_Plugins_Controller::prepare_links() WP 5.5.1

<?php
protected function prepare_links( $item ) {
	return array(
		'self' => array(
			'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, substr( $item['_file'], 0, - 4 ) ) ),
		),
	);
}