Changeset 52275 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php
- Timestamp:
- 11/30/2021 12:22:30 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php
r52103 r52275 233 233 */ 234 234 public function prepare_item_for_response( $post, $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable 235 $config = json_decode( $post->post_content, true ); 236 $is_global_styles_user_theme_json = isset( $config['isGlobalStylesUserThemeJSON'] ) && true === $config['isGlobalStylesUserThemeJSON']; 237 $fields = $this->get_fields_for_response( $request ); 235 $raw_config = json_decode( $post->post_content, true ); 236 $is_global_styles_user_theme_json = isset( $raw_config['isGlobalStylesUserThemeJSON'] ) && true === $raw_config['isGlobalStylesUserThemeJSON']; 237 $config = array(); 238 if ( $is_global_styles_user_theme_json ) { 239 $config = ( new WP_Theme_JSON( $raw_config, 'custom' ) )->get_raw_data(); 240 } 238 241 239 242 // Base fields for every post. 240 $data = array(); 243 $data = array(); 244 $fields = $this->get_fields_for_response( $request ); 241 245 242 246 if ( rest_is_field_included( 'id', $fields ) ) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)