Skip to content

Commit

Permalink
Require module asset file only if it exists
Browse files Browse the repository at this point in the history
Co-authored-by: Greg Ziółkowski <[email protected]>
  • Loading branch information
sirreal and gziolo committed Feb 8, 2024
1 parent dfe2d77 commit d12e711
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wp-includes/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function register_block_script_module_id( $metadata, $field_name, $index = 0 ) {
$module_path_norm = wp_normalize_path( realpath( $path . '/' . $module_path ) );
$module_uri = get_block_asset_url( $module_path_norm );

$module_asset = @include $module_asset_path;
$module_asset = ! empty( $module_asset_path ) ? require $module_asset_path : array();
$module_dependencies = isset( $module_asset['dependencies'] ) ? $module_asset['dependencies'] : array();

wp_register_script_module(
Expand Down

0 comments on commit d12e711

Please sign in to comment.