Skip to content

Commit

Permalink
Core viewScriptModule should be suffixed with -script-module
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Feb 5, 2024
1 parent 8bda79c commit 8789667
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/wp-includes/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ function generate_block_asset_handle( $block_name, $field_name, $index = 0 ) {
if ( str_starts_with( $field_name, 'view' ) ) {
$asset_handle .= '-view';
}
if ( str_ends_with( strtolower( $field_name ), 'scriptmodule' ) ) {
$asset_handle .= '-script-module';
}
if ( $index > 0 ) {
$asset_handle .= '-' . ( $index + 1 );
}
Expand Down

0 comments on commit 8789667

Please sign in to comment.