Skip to content
Closed
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
b64aab8
Enhancement: Add 'in_footer' argument to script module functions for …
b1ink0 Sep 13, 2025
1caf38a
Split printing into head/footer passes with printed script module tra…
b1ink0 Sep 18, 2025
4115360
Skip printing script modules in head if dependencies are set to print…
b1ink0 Sep 18, 2025
05584fc
Sort script module identifiers by dependencies before printing
b1ink0 Sep 24, 2025
ac4973c
Fix failing tests caused by tracking of printed script modules
b1ink0 Sep 29, 2025
040c249
Fix PHPCS warnings
b1ink0 Sep 29, 2025
e55cf3e
Improve documentation and add type hints
b1ink0 Sep 30, 2025
c794fad
Consolidate multi-line assignment to single expression
b1ink0 Sep 30, 2025
acaeceb
Use Reflection API to access done property in tests
b1ink0 Sep 30, 2025
8bc8f69
Remove unnecessary checks for `done` array
b1ink0 Oct 1, 2025
43bb39b
Add tests for head/footer placement and dependency ordering
b1ink0 Oct 9, 2025
377989d
Fix formatting by removing trailing comma
b1ink0 Oct 9, 2025
09897f5
Merge branch 'trunk' into enhancement/63486-script-modules-footer-sup…
b1ink0 Oct 14, 2025
8dfc49a
Merge branch 'trunk' of https://github.com/WordPress/wordpress-develo…
westonruter Oct 17, 2025
45a40a3
Simplify script module printing methods
b1ink0 Oct 17, 2025
c8ccf33
Merge branch 'trunk' into enhancement/63486-script-modules-footer-sup…
westonruter Oct 17, 2025
5aef0c7
Move done member up next to queue member
westonruter Oct 17, 2025
3e96498
Address majority of PHPStan level 10 issues in class-wp-script-module…
westonruter Oct 17, 2025
9915940
Remove unused get_marked_for_enqueue() method
westonruter Oct 17, 2025
858ef91
Further refine types
westonruter Oct 17, 2025
4203864
Allow empty src for script module for the sake of Tests_Blocks_Regist…
westonruter Oct 17, 2025
8c71e84
Use more specific types
westonruter Oct 17, 2025
e60e4fa
Re-work get_dependencies() to return an array of script module IDs
westonruter Oct 17, 2025
dbdd3a1
Account for empty src for script module
westonruter Oct 17, 2025
78c7e7a
Simplify get_recursive_dependents() to remove closure
westonruter Oct 17, 2025
40e1260
Refactor get_sorted_dependencies() to eliminate closure
westonruter Oct 18, 2025
aeb22f0
Add missing '>'
westonruter Oct 18, 2025
9ba920a
Use get_sorted_dependencies() when printing preloads and only for sta…
westonruter Oct 18, 2025
60fd75f
Reduce nesting in print_script_module_preloads()
westonruter Oct 18, 2025
2438a12
Disregard the done array when getting sorted item dependencies
westonruter Oct 18, 2025
6b62d90
Remove the need for set_printed_script_modules() in test
westonruter Oct 18, 2025
1bba6a3
Ensure core script modules and iAPI script modules are printed in foo…
westonruter Oct 18, 2025
2c35487
Merge branch 'trunk' into enhancement/63486-script-modules-footer-sup…
westonruter Oct 19, 2025
2a695c5
Add test case for static dependency on dynamic which depends on anoth…
westonruter Oct 19, 2025
47a0013
Merge branch 'trunk' into enhancement/63486-script-modules-footer-sup…
westonruter Oct 20, 2025
b652fdd
Extract repeated wp_is_block_theme() calls into variable
westonruter Oct 20, 2025
de83bd2
Restore $position variable containing action name
westonruter Oct 20, 2025
379cba0
Merge branch 'trunk' into enhancement/63486-script-modules-footer-sup…
westonruter Oct 20, 2025
7c2e9c5
Remove PHPStan annotations
westonruter Oct 20, 2025
b1b7043
Add tests for enqueue and register with empty string for ID
westonruter Oct 20, 2025
58044f1
Improve empty src handling in get_src() and add test
westonruter Oct 20, 2025
0c46399
Merge branch 'trunk' into enhancement/63486-script-modules-footer-sup…
westonruter Oct 20, 2025
49c3d5b
Add missing WP_Script_Modules::set_in_footer() method
westonruter Oct 20, 2025
2950c7d
Add ticket references
westonruter Oct 20, 2025
4459c6f
Merge branch 'trunk' of https://github.com/WordPress/wordpress-develo…
westonruter Oct 20, 2025
cde9ccf
Replace non-empty-string with string to amend 7c2e9c5ff3
westonruter Oct 20, 2025
04ec8ac
Restore private get_marked_for_enqueue() method since used via Reflec…
westonruter Oct 21, 2025
4fc5e27
Fix phpcs
westonruter Oct 21, 2025
bf733b2
Make note that in_footer only applies to block themes
westonruter Oct 21, 2025
922dcf0
Remove redundant array_unique()
westonruter Oct 21, 2025
d91f8c3
Remove another redundant array_unique()
westonruter Oct 21, 2025
c0179e6
Use multi-line comment
westonruter Oct 21, 2025
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
1 change: 1 addition & 0 deletions src/wp-includes/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ function register_block_script_module_id( $metadata, $field_name, $index = 0 ) {
( isset( $metadata['supports']['interactivity']['interactive'] ) && true === $metadata['supports']['interactivity']['interactive'] )
) {
$args['fetchpriority'] = 'low';
$args['in_footer'] = true;
Copy link
Member

Choose a reason for hiding this comment

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

This is the key change that is done en lieu of in_footer being set via blocks.json per Core-54018.

}

wp_register_script_module(
Expand Down
Loading
Loading