WP_REST_Global_Styles_Controller::prepare_links()protectedWP 5.9.0

Prepares links for the request.

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

No Hooks.

Return

Array. Links for the given post.

Usage

// protected - for code of main (parent) or child class
$result = $this->prepare_links( $id );
$id(int) (required)
ID.

Changelog

Since 5.9.0 Introduced.

Code of WP_REST_Global_Styles_Controller::prepare_links() WP 6.0

protected function prepare_links( $id ) {
	$base = sprintf( '%s/%s', $this->namespace, $this->rest_base );

	$links = array(
		'self' => array(
			'href' => rest_url( trailingslashit( $base ) . $id ),
		),
	);

	return $links;
}