diff --git a/src/wp-admin/admin-header.php b/src/wp-admin/admin-header.php index 92fbd3a4a2f79..8d935bb2b86e7 100644 --- a/src/wp-admin/admin-header.php +++ b/src/wp-admin/admin-header.php @@ -100,18 +100,45 @@ wp_enqueue_script( 'svg-painter' ); $admin_body_class = preg_replace( '/[^a-z0-9_-]+/i', '-', $hook_suffix ); -?> - - admin_url( 'admin-ajax.php', 'relative' ), + 'pagenow' => $current_screen->id, + 'typenow' => $current_screen->post_type, + 'adminpage' => $admin_body_class, + 'thousandsSeparator' => $wp_locale->number_format['thousands_sep'], + 'decimalPoint' => $wp_locale->number_format['decimal_point'], + 'isRtl' => (int) is_rtl(), + ), + 0 | JSON_HEX_TAG | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_LINE_TERMINATORS + ) + ) +); /** * Fires when enqueuing scripts for all admin pages. @@ -253,11 +280,13 @@ $admin_body_classes = ltrim( $admin_body_classes . ' ' . $admin_body_class ); ?> - - - - - - admin_url( 'admin-ajax.php', 'relative' ), + 'pagenow' => 'media-upload-popup', + 'adminpage' => 'media-upload-popup', + 'isRtl' => (int) is_rtl(), + ), + 0 | JSON_HEX_TAG | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_LINE_TERMINATORS + ) + ) + ); /** This action is documented in wp-admin/admin-header.php */ do_action( 'admin_enqueue_scripts', 'media-upload-popup' ); @@ -630,10 +656,12 @@ function wp_iframe( $content_func, ...$args ) { ?> class="wp-core-ui no-js "> - - + - - post_id = ' . $post_id . ';'; + wp_print_inline_script_tag( + sprintf( 'var post_id = %s;', wp_json_encode( $post_id ) ) + ); if ( empty( $_GET['chromeless'] ) ) { echo '
'; @@ -2248,7 +2285,6 @@ function media_upload_form( $errors = null ) { $plupload_init = apply_filters( 'plupload_init', $plupload_init ); ?> -
- + 0 ) { + preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');}); + } + updateMediaForm(); + }); + JS + ); + ?>
0 ) { + preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');}); + updateMediaForm(); + } + }); + JS + ); ?> -
@@ -2925,15 +2977,19 @@ function media_upload_library_form( $errors ) {
- + 0 ) { + preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');}); + updateMediaForm(); + } + }); + JS + ); + ?>