File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -291,12 +291,20 @@ function gutenberg_get_theme_directory_pattern_slugs() {
291
291
return WP_Theme_JSON_Resolver_Gutenberg::get_theme_data ( array (), array ( 'with_supports ' => false ) )->get_patterns ();
292
292
}
293
293
294
- function add_variation_class_to_body ( $ classes ) {
294
+ /**
295
+ * Adds the `uses-style-variation` and `is-style-variation-name` classes to the body if a theme style variation is used.
296
+ *
297
+ * @since 6.4.0
298
+ *
299
+ * @param array $classes Classes for the body element.
300
+ * @return array Filtered classes for the body element.
301
+ */
302
+ function gutenberg_add_variation_class_to_body ( $ classes ) {
295
303
$ custom = wp_get_global_settings ( array ( 'custom ' ) );
296
- if ( isset ($ custom ['variation ' ]) && 'Default ' !== $ custom ['variation ' ] ) {
304
+ if ( isset ( $ custom ['variation ' ] ) && 'Default ' !== $ custom ['variation ' ] ) {
297
305
$ classes [] = 'uses-style-variation ' ;
298
- $ classes [] = _wp_to_kebab_case ('is style variation ' . $ custom ['variation ' ]);
306
+ $ classes [] = _wp_to_kebab_case ( 'is style variation ' . $ custom ['variation ' ] );
299
307
}
300
308
return $ classes ;
301
309
}
302
- add_filter ( 'body_class ' ,' add_variation_class_to_body ' );
310
+ add_filter ( 'body_class ' , ' gutenberg_add_variation_class_to_body ' );
You can’t perform that action at this time.
0 commit comments