Gets the global styles revision, if the ID is valid.
Parameters
$idintrequired- Supplied ID.
Source
$parent = $this->get_parent( $request['parent'] );
$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'] ) ) {
/*
* Register block style variations from the theme data.
* This is required so the variations pass sanitization of theme.json data.
*/
if ( ! empty( $global_styles_config['styles']['blocks'] ) ) {
Changelog
| Version | Description |
|---|---|
| 6.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.