You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/wp-includes/class-wp-scripts.php
+6-7Lines changed: 6 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -997,10 +997,10 @@ private function get_eligible_loading_strategy( $handle ) {
997
997
*
998
998
* @since 6.3.0
999
999
*
1000
-
* @param string $handle The script handle.
1001
-
* @param string[]|null $eligible_strategies Optional. The list of strategies to filter. Default null.
1002
-
* @param array<string, true> $checked Optional. An array of already checked script handles, used to avoid recursive loops.
1003
-
* @param array<string, string[]> $stored_results Optional. An array of already computed eligible loading strategies by handle, used to increase performance in large dependency lists.
1000
+
* @param string $handle The script handle.
1001
+
* @param string[]|null $eligible_strategies Optional. The list of strategies to filter. Default null.
1002
+
* @param array<string, true> $checked Optional. An array of already checked script handles, used to avoid recursive loops.
1003
+
* @param array<string, string[]> $stored_results Optional. An array of already computed eligible loading strategies by handle, used to increase performance in large dependency lists.
1004
1004
* @return string[] A list of eligible loading strategies that could be used.
* @param array<string, true> $checked Optional. An array of already checked script handles, used to avoid recursive loops.
1074
+
* @param string $handle Script module ID.
1075
+
* @param array<string, true> $checked Optional. An array of already checked script handles, used to avoid recursive loops.
1076
1076
* @param array<string, string> $stored_results Optional. An array of already computed max priority by handle, used to increase performance in large dependency lists.
1077
-
*
1078
1077
* @return string|null Highest fetch priority for the script and its dependents.
@@ -1496,6 +1497,7 @@ public function test_highest_fetchpriority_with_dependents_uses_cached_result_fo
1496
1497
'Expected "high" indicates that the cached `$stored_results` entry for D was used instead of recalculating.'
1497
1498
);
1498
1499
}
1500
+
1499
1501
/**
1500
1502
* Tests that printing a script without enqueueing has the same output as when it is enqueued.
1501
1503
*
@@ -1594,9 +1596,8 @@ public function test_loading_strategy_with_valid_blocking_registration() {
1594
1596
$expected = str_replace( "'", '"', $expected );
1595
1597
$this->assertSame( $expected, $output, 'Scripts registered with no strategy assigned, and who have no dependencies, should have no loading strategy attributes printed.' );
1596
1598
}
1599
+
1597
1600
/**
1598
-
* @ticket 64194
1599
-
*
1600
1601
* Tests that `WP_Scripts::filter_eligible_strategies()` correctly reuses cached results
1601
1602
* for shared dependencies in a diamond-shaped dependency graph.
1602
1603
*
@@ -1610,6 +1611,9 @@ public function test_loading_strategy_with_valid_blocking_registration() {
1610
1611
* In this scenario, both B and C depend on D, and A depends on both B and C.
1611
1612
* The goal is to confirm that when `$stored_results` already contains an entry for D,
1612
1613
* the cached value is reused instead of recalculating the strategies for D multiple times.
0 commit comments