Make WordPress Core

Changeset 61388


Ignore:
Timestamp:
12/16/2025 11:36:47 PM (8 weeks ago)
Author:
SergeyBiryukov
Message:

Script Loader: Check if $_wp_admin_css_colors is set in wp_style_loader_src().

This aims to avoid PHP warnings if the colors dependency is loaded or the style_loader_src filter is used in a context where the $_wp_admin_css_colors global does not exist.

Follow-up to [7976].

Props crstauf, petitphp, SergeyBiryukov.
Fixes #61302.

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r61322 r61388  
    20912091        }
    20922092
    2093         $color = $_wp_admin_css_colors[ $color ];
    2094         $url   = $color->url;
     2093        $color = $_wp_admin_css_colors[ $color ] ?? null;
     2094        $url   = $color->url ?? '';
    20952095
    20962096        if ( ! $url ) {
Note: See TracChangeset for help on using the changeset viewer.