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.
Built from https://develop.svn.wordpress.org/trunk@52676


git-svn-id: http://core.svn.wordpress.org/trunk@52265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2022-02-04 14:18:59 +00:00
parent e8e20a2823
commit 4cbad9a9aa
2 changed files with 15 additions and 11 deletions

View File

@ -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' );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.0-alpha-52675';
$wp_version = '6.0-alpha-52676';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.