On this page
WP_REST_Global_Styles_Controller::prepare_links( integer $id ): array
Prepares links for the request.
Parameters
$idinteger Required-
ID.
Return
array Links for the given post.
Source
File: wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php. View all references
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;
}
Related
Uses
| Uses | Description |
|---|---|
| rest_url() wp-includes/rest-api.php | Retrieves the URL to a REST endpoint. |
| trailingslashit() wp-includes/formatting.php | Appends a trailing slash. |
Used By
| Used By | Description |
|---|---|
| WP_REST_Global_Styles_Controller::prepare_item_for_response() wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php | Prepare a global styles config output for response. |
Changelog
| Version | Description |
|---|---|
| 5.9.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_global_styles_controller/prepare_links