Opened 13 months ago
Last modified 13 months ago
#63043 new defect (bug)
script-loader 'colors' src true invalid argument
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Script Loader | Keywords: | has-patch |
| Focuses: | Cc: |
Description
https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/script-loader.php#L1587
<?php $styles->add( 'colors', true, array( 'wp-admin', 'buttons' ) );
true is not a valid 2nd argument for add, string|false expected.
Change History (2)
This ticket was mentioned in PR #8437 on WordPress/wordpress-develop by @abcd95.
13 months ago
#1
- Keywords has-patch added
#2
@
13 months ago
Thank you for reporting this issue.
After testing, I found that changing true to false or an empty string breaks the admin color scheme functionality.
Upon 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(). See this
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.
Trac ticket: https://core.trac.wordpress.org/ticket/63043