diff --git a/packages/interactivity/src/store.ts b/packages/interactivity/src/store.ts index ea5ef07a2613eb..ddadc01c0bbf1b 100644 --- a/packages/interactivity/src/store.ts +++ b/packages/interactivity/src/store.ts @@ -320,9 +320,11 @@ export function store( } export const parseInitialData = ( dom = document ) => { - const jsonDataScriptTag = dom.getElementById( - 'wp-scriptmodule-data_@wordpress/interactivity' - ); + const jsonDataScriptTag = + // Preferred Script Module data passing form + dom.getElementById( 'wp-scriptmodule-data_@wordpress/interactivity' ) ?? + // Legacy form + dom.getElementById( 'wp-interactivity-data' ); if ( jsonDataScriptTag?.textContent ) { try { return JSON.parse( jsonDataScriptTag.textContent );