Skip to content

Commit e4d101a

Browse files
Use wp_add_inline_script
1 parent bd55a8b commit e4d101a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

projects/packages/jetpack-mu-wpcom/src/features/wpcom-imports/wpcom-imports.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,14 @@ function wpcom_imports_enqueue_script() {
125125

126126
$url = 'https://wordpress.com/setup/site-migration/site-migration-identify?hide_importer_link=true&siteSlug=' . $domain . '&siteId=' . $site_id;
127127

128-
wp_localize_script(
128+
wp_add_inline_script(
129129
'wpcom-importer-entry',
130-
'wpcomImporterData',
131-
array(
132-
'wpcomImporterUrl' => $url,
133-
)
130+
'const wpcomImporterData = ' . wp_json_encode(
131+
array(
132+
'wpcomImporterUrl' => $url,
133+
)
134+
) . ';',
135+
'before'
134136
);
135137
}
136138

0 commit comments

Comments
 (0)