Retrieves one global styles revision from the collection.
$requestWP_REST_Requestrequired
$global_styles_config = $this->get_decoded_global_styles_json( $post->post_content );
if ( is_wp_error( $global_styles_config ) ) {
return $global_styles_config;
}
$fields = $this->get_fields_for_response( $request );
$data = array();
$theme_json = null;
if ( ! empty( $global_styles_config['styles'] ) || ! empty( $global_styles_config['settings'] ) ) {
$theme_json = new WP_Theme_JSON( $global_styles_config, 'custom' );
$global_styles_config = $theme_json->get_raw_data();
if ( rest_is_field_included( 'settings', $fields ) ) {
| Version | Description |
|---|---|
| 6.5.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_global_styles_revisions_controller/get_item