Skip to content

Commit bfb9e11

Browse files
committed
Revert param name change
1 parent 9892937 commit bfb9e11

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

plugins/web-worker-offloading/hooks.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ function wwo_register_default_scripts( WP_Scripts $scripts ): void {
7979
*
8080
* @since 0.1.0
8181
*
82-
* @param string[]|mixed $to_do An array of enqueued script dependency handles.
82+
* @param string[]|mixed $script_handles An array of enqueued script dependency handles.
8383
* @return string[] Script handles.
8484
*/
85-
function wwo_filter_print_scripts_array( $to_do ): array {
85+
function wwo_filter_print_scripts_array( $script_handles ): array {
8686
$scripts = wp_scripts();
87-
foreach ( (array) $to_do as $handle ) {
87+
foreach ( (array) $script_handles as $handle ) {
8888
if ( true === (bool) $scripts->get_data( $handle, 'worker' ) ) {
8989
$scripts->set_group( 'web-worker-offloading', false, 0 ); // Try to print in the head.
90-
array_unshift( $to_do, 'web-worker-offloading' );
90+
array_unshift( $script_handles, 'web-worker-offloading' );
9191

9292
// TODO: This should be reconsidered because scripts needing to be offloaded will often have after scripts. See <https://github.com/WordPress/performance/pull/1497/files#r1733538721>.
9393
if ( false === wp_scripts()->get_data( $handle, 'strategy' ) ) {
@@ -96,7 +96,7 @@ function wwo_filter_print_scripts_array( $to_do ): array {
9696
}
9797
}
9898
}
99-
return $to_do;
99+
return $script_handles;
100100
}
101101
add_filter( 'print_scripts_array', 'wwo_filter_print_scripts_array' );
102102

0 commit comments

Comments
 (0)