Make WordPress Core

Changeset 52676


Ignore:
Timestamp:
02/04/2022 02:17:36 PM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/global-styles-and-settings.php

    r52675 r52676  
    113113    }
    114114
    115     // If variables are part of the stylesheet,
    116     // we add them for all origins (default, theme, user).
    117     // This is so themes without a theme.json still work as before 5.9:
    118     // they can override the default presets.
    119     // See https://core.trac.wordpress.org/ticket/54782
     115    /*
     116     * If variables are part of the stylesheet,
     117     * we add them for all origins (default, theme, user).
     118     * This is so themes without a theme.json still work as before 5.9:
     119     * they can override the default presets.
     120     * See https://core.trac.wordpress.org/ticket/54782
     121     */
    120122    $styles_variables = '';
    121     if ( in_array( 'variables', $types ) ) {
     123    if ( in_array( 'variables', $types, true ) ) {
    122124        $styles_variables = $tree->get_stylesheet( array( 'variables' ) );
    123125        $types            = array_diff( $types, array( 'variables' ) );
    124126    }
    125127
    126     // For the remaining types (presets, styles), we do consider origins:
    127     //
    128     // - themes without theme.json: only the classes for the presets defined by core
    129     // - themes with theme.json: the presets and styles classes, both from core and the theme
     128    /*
     129     * For the remaining types (presets, styles), we do consider origins:
     130     *
     131     * - themes without theme.json: only the classes for the presets defined by core
     132     * - themes with theme.json: the presets and styles classes, both from core and the theme
     133     */
    130134    $styles_rest = '';
    131135    if ( ! empty( $types ) ) {
Note: See TracChangeset for help on using the changeset viewer.