Skip to content

Commit f4d641c

Browse files
committed
Add environment context to imageStudioData global
1 parent 53c6b0f commit f4d641c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

projects/plugins/jetpack/extensions/plugins/image-studio/image-studio.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,13 @@ function do_enqueue_assets() {
299299

300300
wp_add_inline_script(
301301
FEATURE_NAME,
302-
'if ( typeof window.imageStudioData === "undefined" ) { window.imageStudioData = ' . wp_json_encode( array( 'enabled' => true ), JSON_HEX_TAG | JSON_HEX_AMP ) . '; }',
302+
'if ( typeof window.imageStudioData === "undefined" ) { window.imageStudioData = ' . wp_json_encode(
303+
array(
304+
'enabled' => true,
305+
'environment' => is_ciab_environment() ? 'ciab-admin' : 'wp-admin',
306+
),
307+
JSON_HEX_TAG | JSON_HEX_AMP
308+
) . '; }',
303309
'before'
304310
);
305311

0 commit comments

Comments
 (0)