Skip to content

Commit

Permalink
Use expected core filter name and element ID
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed May 14, 2024
1 parent 5c6c562 commit 84810f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/experimental/script-modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function gutenberg_print_script_module_data(): void {
}

foreach ( array_keys( $modules ) as $module_id ) {
$data = apply_filters( 'gb_scriptmoduledata_' . $module_id, array() );
$data = apply_filters( 'scriptmoduledata_' . $module_id, array() );
if ( ! empty( $data ) ) {
/*
* This data will be printed as JSON inside a script tag like this:
Expand Down Expand Up @@ -264,7 +264,7 @@ function gutenberg_print_script_module_data(): void {
wp_json_encode( $data, $json_encode_flags ),
array(
'type' => 'application/json',
'id' => 'gb-scriptmodule-data_' . $module_id,
'id' => 'wp-scriptmodule-data_' . $module_id,
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/interactivity/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export function store(

export const parseInitialData = ( dom = document ) => {
const jsonDataScriptTag = dom.getElementById(
'gb-scriptmodule-data_@wordpress/interactivity'
'wp-scriptmodule-data_@wordpress/interactivity'
);
if ( jsonDataScriptTag?.textContent ) {
try {
Expand Down

0 comments on commit 84810f8

Please sign in to comment.