WP_REST_Global_Styles_Controller::prepare_links() WordPress Method
The prepare_links() method is used to add links to the global styles REST API response data. This allows for easy navigation between global styles when using the REST API. The prepare_links() method accepts an array of links as its only parameter.
WP_REST_Global_Styles_Controller::prepare_links( integer $id ) #
Prepares links for the request.
Parameters
- $id
(integer)(Required)ID.
Return
(array) Links for the given post.
Source
File: wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php
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; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.9.0 | Introduced. |