From c6c3d9b928b08408918c8651f3125ec15974289b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 4 Feb 2022 14:17:36 +0000 Subject: [PATCH] Coding Standards: Use strict type check for `in_array()` in `wp_get_global_stylesheet()`. Use multi-line comment syntax for some comments, per the documentation standards. Follow-up to [52675]. See #54782. git-svn-id: https://develop.svn.wordpress.org/trunk@52676 602fd350-edb4-49c9-b593-d223f7449a82 --- .../global-styles-and-settings.php | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/wp-includes/global-styles-and-settings.php b/src/wp-includes/global-styles-and-settings.php index f8cd905fdc..0e382fe483 100644 --- a/src/wp-includes/global-styles-and-settings.php +++ b/src/wp-includes/global-styles-and-settings.php @@ -112,21 +112,25 @@ function wp_get_global_stylesheet( $types = array() ) { $types = array( 'variables', 'styles', 'presets' ); } - // If variables are part of the stylesheet, - // we add them for all origins (default, theme, user). - // This is so themes without a theme.json still work as before 5.9: - // they can override the default presets. - // See https://core.trac.wordpress.org/ticket/54782 + /* + * If variables are part of the stylesheet, + * we add them for all origins (default, theme, user). + * This is so themes without a theme.json still work as before 5.9: + * they can override the default presets. + * See https://core.trac.wordpress.org/ticket/54782 + */ $styles_variables = ''; - if ( in_array( 'variables', $types ) ) { + if ( in_array( 'variables', $types, true ) ) { $styles_variables = $tree->get_stylesheet( array( 'variables' ) ); $types = array_diff( $types, array( 'variables' ) ); } - // For the remaining types (presets, styles), we do consider origins: - // - // - themes without theme.json: only the classes for the presets defined by core - // - themes with theme.json: the presets and styles classes, both from core and the theme + /* + * For the remaining types (presets, styles), we do consider origins: + * + * - themes without theme.json: only the classes for the presets defined by core + * - themes with theme.json: the presets and styles classes, both from core and the theme + */ $styles_rest = ''; if ( ! empty( $types ) ) { $origins = array( 'default', 'theme', 'custom' );