Changeset 53129 for trunk/src/wp-includes/class-wp-theme-json-resolver.php
- Timestamp:
- 04/11/2022 10:36:02 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json-resolver.php
r53072 r53129 152 152 * @since 5.8.0 153 153 * @since 5.9.0 Theme supports have been inlined and the `$theme_support_data` argument removed. 154 * @since 6.0.0 Adds a second parameter to allow the theme data to be returned without theme supports. 154 155 * 155 156 * @param array $deprecated Deprecated. Not used. 157 * @param array $options Contains a key called with_supports to determine whether to include theme supports in the data. 156 158 * @return WP_Theme_JSON Entity that holds theme data. 157 159 */ 158 public static function get_theme_data( $deprecated = array() ) {160 public static function get_theme_data( $deprecated = array(), $options = array() ) { 159 161 if ( ! empty( $deprecated ) ) { 160 162 _deprecated_argument( __METHOD__, '5.9.0' ); 161 163 } 164 165 $options = wp_parse_args( $options, array( 'with_supports' => true ) ); 166 162 167 if ( null === static::$theme ) { 163 168 $theme_json_data = static::read_json_file( static::get_file_path_from_theme( 'theme.json' ) ); … … 176 181 static::$theme = $parent_theme; 177 182 } 183 } 184 185 if ( ! $options['with_supports'] ) { 186 return static::$theme; 178 187 } 179 188 … … 209 218 } 210 219 $theme_support_data['settings']['color']['defaultGradients'] = $default_gradients; 220 221 // Classic themes without a theme.json don't support global duotone. 222 $theme_support_data['settings']['color']['defaultDuotone'] = false; 211 223 } 212 224 $with_theme_supports = new WP_Theme_JSON( $theme_support_data ); … … 478 490 return $variations; 479 491 } 492 480 493 }
Note: See TracChangeset
for help on using the changeset viewer.