Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ded6e2e
Add failing test case to capture the Elementor scenario
westonruter Feb 6, 2026
485549b
Add global-styles placeholder which is replaced during hoisting
westonruter Feb 6, 2026
ec819ad
Add test case for blockless theme without theme.json
westonruter Feb 6, 2026
2f8713c
Ensure global styles placeholder is removed even when there is no glo…
westonruter Feb 6, 2026
2282411
Use actual CSS instead of comment in case a minifier tries to strip o…
westonruter Feb 6, 2026
b7b1740
Remove obsolete conditions for inserting global-styles
westonruter Feb 6, 2026
4f99b7d
Refine comment copy
westonruter Feb 6, 2026
45ec7f4
Update return tag for data provider to reflect new array shape
westonruter Feb 6, 2026
ff8cbc1
Fix priority in comment regarding wp_custom_css_cb()
westonruter Feb 6, 2026
48eb4f6
Preserve CSS cascade so wp-block-library inline styles appear after i…
westonruter Feb 10, 2026
062fdad
Merge branch 'trunk' of https://github.com/WordPress/wordpress-develo…
westonruter Feb 10, 2026
75eb70a
Merge branch 'trunk' into trac-64389
westonruter Mar 4, 2026
2cf0787
Leverage HTML Tag Processor in test
westonruter Mar 4, 2026
6b5633d
Use HTML Tag Processor to safely construct STYLE tag
westonruter Mar 4, 2026
80472f0
Add conditional return types and remove redundant param type for has_…
westonruter Mar 4, 2026
0c0f529
Fix PHPStan level 8 issues in wp_hoist_late_printed_styles()
westonruter Mar 4, 2026
c82418b
Address PHPStan issues with test_wp_hoist_late_printed_styles
westonruter Mar 4, 2026
e72fc45
Clarify comment
westonruter Mar 4, 2026
d54326f
Eliminate looking for classic-theme-styles in favor of adding placeho…
westonruter Mar 4, 2026
c09f349
Remove obsolete references to classic-theme-styles
westonruter Mar 4, 2026
59bdc8d
Fix grammatical typo in comment
westonruter Mar 4, 2026
ddcb748
Account for possibility of no sourceURL comment being present
westonruter Mar 4, 2026
87a5ccb
Improve grammar in comment
westonruter Mar 4, 2026
17443f4
Remove arg from being passed needlessly to assert closure
westonruter Mar 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions src/wp-includes/plugin.php
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this file I don't intend to commit as part of this PR. They belong in a PR for Core-64238. Nevertheless, I added the changes here to ensure all of the new code introduced as part of wp_hoist_late_printed_styles() is fully passing PHPStan rule level 8.

Original file line number Diff line number Diff line change
Expand Up @@ -271,17 +271,23 @@ function apply_filters_ref_array( $hook_name, $args ) {
*
* @global WP_Hook[] $wp_filter Stores all of the filters and actions.
*
* @param string $hook_name The name of the filter hook.
* @param callable|string|array|false $callback Optional. The callback to check for.
* This function can be called unconditionally to speculatively check
* a callback that may or may not exist. Default false.
* @param int|false $priority Optional. The specific priority at which to check for the callback.
* Default false.
* @param string $hook_name The name of the filter hook.
* @param callable|false $callback Optional. The callback to check for.
* This function can be called unconditionally to speculatively check
* a callback that may or may not exist. Default false.
* @param int|false $priority Optional. The specific priority at which to check for the callback.
* Default false.
* @return bool|int If `$callback` is omitted, returns boolean for whether the hook has
* anything registered. When checking a specific function, the priority
* of that hook is returned, or false if the function is not attached.
* If `$callback` and `$priority` are both provided, a boolean is returned
* for whether the specific function is registered at that priority.
*
* @phpstan-return (
* $callback is false ? bool : (
* $priority is false ? int|false : bool
* )
* )
*/
function has_filter( $hook_name, $callback = false, $priority = false ) {
global $wp_filter;
Expand Down Expand Up @@ -583,17 +589,23 @@ function do_action_ref_array( $hook_name, $args ) {
*
* @see has_filter() This function is an alias of has_filter().
*
* @param string $hook_name The name of the action hook.
* @param callable|string|array|false $callback Optional. The callback to check for.
* This function can be called unconditionally to speculatively check
* a callback that may or may not exist. Default false.
* @param int|false $priority Optional. The specific priority at which to check for the callback.
* Default false.
* @param string $hook_name The name of the action hook.
* @param callable|false $callback Optional. The callback to check for.
* This function can be called unconditionally to speculatively check
* a callback that may or may not exist. Default false.
* @param int|false $priority Optional. The specific priority at which to check for the callback.
* Default false.
* @return bool|int If `$callback` is omitted, returns boolean for whether the hook has
* anything registered. When checking a specific function, the priority
* of that hook is returned, or false if the function is not attached.
* If `$callback` and `$priority` are both provided, a boolean is returned
* for whether the specific function is registered at that priority.
*
* @phpstan-return (
* $callback is false ? bool : (
* $priority is false ? int|false : bool
* )
* )
*/
function has_action( $hook_name, $callback = false, $priority = false ) {
return has_filter( $hook_name, $callback, $priority );
Expand Down
Loading
Loading