Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #63043, comment 2


Ignore:
Timestamp:
03/03/2025 08:06:07 AM (13 months ago)
Author:
abcd95
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #63043, comment 2

    v1 v2  
    55Upon closer inspection of `wp_style_loader_src()`, it appears the current implementation expects $src to be a truthy value for the 'colors' handle to properly process it through `parse_url()`. [https://github.com/WordPress/wordpress-develop/blob/b4f0fc916ef58c0285f119e24f56e90831fcfc48/src/wp-includes/script-loader.php#L2070 See this]
    66
    7 While technically true doesn't match the expected `string|false` type, it's a historical implementation detail that's working in practice. I think it's best to document this behavior rather than changing it for backward compatibility.
     7While technically true doesn't match the expected `string|false` type, it's a historical implementation detail that's working in practice. I think it's best to document this behavior rather than change it for backward compatibility.
     8
     9
     10Follow-up:
     11
     12After further testing, I found that we can use any non-falsy string instead of true while maintaining the admin color scheme functionality. The `wp_style_loader_src()` function only needs a truthy value to process.
     13
     14This opens up an opportunity to use a more descriptive string that both satisfies type requirements and documents the intent. Options could include 'placeholder', 'dynamic-color-scheme', or even just '#'.
     15
     16This is open for discussion and I'd appreciate any appropriate placeholder suggestion for this.