Skip to content

Commit

Permalink
Make preload only for block themes at head
Browse files Browse the repository at this point in the history
  • Loading branch information
cbravobernal committed Dec 27, 2023
1 parent 7c97c8e commit 3edb69f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/experimental/modules/class-gutenberg-modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,13 @@ function gutenberg_dequeue_module( $module_identifier ) {
// Prints the import map in the head tag in block themes. Otherwise in the footer.
add_action( $modules_position, array( 'Gutenberg_Modules', 'print_import_map' ) );

// Prints the enqueued modules in the head tag in block themes. Otherwise in the footer.
// Prints the enqueued modules in the head tag in block themes.
add_action( $modules_position, array( 'Gutenberg_Modules', 'print_enqueued_modules' ) );

// Prints the preloaded modules in the head tag in block themes. Otherwise in the footer.
add_action( $modules_position, array( 'Gutenberg_Modules', 'print_module_preloads' ) );
// Prints the preloaded modules in the head tag in block themes.
if ( 'wp_head' === $modules_position ) {
add_action( 'wp_head', array( 'Gutenberg_Modules', 'print_module_preloads' ) );
}

// Prints the script that loads the import map polyfill in the footer.
add_action( 'wp_footer', array( 'Gutenberg_Modules', 'print_import_map_polyfill' ), 11 );

0 comments on commit 3edb69f

Please sign in to comment.