Skip to content

Commit 641cf5a

Browse files
committed
Script Loader: Fix script module fetchpriority calculation when dependent with higher priority is not enqueued.
Developed in WordPress/wordpress-develop#10651 Follow-up to [60931], [60704]. Props westonruter, jonsurrell, youknowriad. See #61734. Fixes #64429. Built from https://develop.svn.wordpress.org/trunk@61401 git-svn-id: http://core.svn.wordpress.org/trunk@60713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 36be5bb commit 641cf5a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

wp-includes/class-wp-script-modules.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,9 @@ private function print_script_module( string $id ) {
461461
'id' => $id . '-js-module',
462462
);
463463

464-
$script_module = $this->registered[ $id ];
465-
$dependents = $this->get_recursive_dependents( $id );
466-
$fetchpriority = $this->get_highest_fetchpriority( array_merge( array( $id ), $dependents ) );
464+
$script_module = $this->registered[ $id ];
465+
$queued_dependents = array_intersect( $this->queue, $this->get_recursive_dependents( $id ) );
466+
$fetchpriority = $this->get_highest_fetchpriority( array_merge( array( $id ), $queued_dependents ) );
467467
if ( 'auto' !== $fetchpriority ) {
468468
$attributes['fetchpriority'] = $fetchpriority;
469469
}

wp-includes/class-wp-scripts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ private function filter_eligible_strategies( $handle, $eligible_strategies = nul
10921092
*
10931093
* @since 6.9.0
10941094
* @see self::filter_eligible_strategies()
1095-
* @see WP_Script_Modules::get_highest_fetchpriority_with_dependents()
1095+
* @see WP_Script_Modules::get_highest_fetchpriority()
10961096
*
10971097
* @param string $handle Script module ID.
10981098
* @param array<string, true> $checked Optional. An array of already checked script handles, used to avoid recursive loops.

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '7.0-alpha-61400';
19+
$wp_version = '7.0-alpha-61401';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)