diff --git a/src/wp-admin/admin-header.php b/src/wp-admin/admin-header.php
index c6760f9b86..7fbbb66623 100644
a
|
b
|
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', |
91 | 91 | decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>', |
92 | 92 | isRtl = <?php echo (int) is_rtl(); ?>; |
93 | 93 | </script> |
94 | | <meta name="viewport" content="width=device-width,initial-scale=1.0"> |
95 | 94 | <?php |
96 | 95 | |
97 | 96 | /** |
diff --git a/src/wp-admin/customize.php b/src/wp-admin/customize.php
index a8b62f4195..000ea8bb88 100644
a
|
b
|
$body_class = 'wp-core-ui wp-customizer js'; |
132 | 132 | |
133 | 133 | if ( wp_is_mobile() ) : |
134 | 134 | $body_class .= ' mobile'; |
135 | | |
136 | | ?> |
137 | | <meta name="viewport" id="viewport-meta" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=1.2" /> |
138 | | <?php |
| 135 | add_filter( 'admin_viewport_meta', '_customizer_mobile_viewport_meta' ); |
139 | 136 | endif; |
140 | 137 | |
141 | 138 | if ( $wp_customize->is_ios() ) { |
… |
… |
do_action( 'customize_controls_print_styles' ); |
171 | 168 | * @since 3.4.0 |
172 | 169 | */ |
173 | 170 | do_action( 'customize_controls_print_scripts' ); |
| 171 | |
| 172 | /** |
| 173 | * Fires when Customizer control scripts are printed. |
| 174 | * |
| 175 | * @since 5.5.0 |
| 176 | */ |
| 177 | do_action( 'customize_controls_head' ); |
174 | 178 | ?> |
175 | 179 | </head> |
176 | 180 | <body class="<?php echo esc_attr( $body_class ); ?>"> |
diff --git a/src/wp-admin/includes/admin-filters.php b/src/wp-admin/includes/admin-filters.php
index 4e66b28bb8..e4d51aa3e1 100644
a
|
b
|
add_action( 'login_init', 'wp_admin_headers' ); |
43 | 43 | add_action( 'admin_head', 'wp_admin_canonical_url' ); |
44 | 44 | add_action( 'admin_head', 'wp_color_scheme_settings' ); |
45 | 45 | add_action( 'admin_head', 'wp_site_icon' ); |
46 | | add_action( 'admin_head', '_ipad_meta' ); |
| 46 | add_action( 'admin_head', 'wp_admin_viewport_meta' ); |
| 47 | add_action( 'customize_controls_head', 'wp_admin_viewport_meta' ); |
47 | 48 | |
48 | 49 | // Prerendering. |
49 | 50 | if ( ! is_customize_preview() ) { |
diff --git a/src/wp-admin/includes/misc.php b/src/wp-admin/includes/misc.php
index 628ec7bb7b..dc5570c0b2 100644
a
|
b
|
function wp_color_scheme_settings() { |
988 | 988 | } |
989 | 989 | |
990 | 990 | /** |
991 | | * @since 3.3.0 |
| 991 | * Displays the viewport meta in the admin. |
| 992 | * |
| 993 | * @since 5.5.0 |
992 | 994 | */ |
993 | | function _ipad_meta() { |
994 | | if ( wp_is_mobile() ) { |
995 | | ?> |
996 | | <meta name="viewport" id="viewport-meta" content="width=device-width, initial-scale=1"> |
997 | | <?php |
| 995 | function wp_admin_viewport_meta() { |
| 996 | /** |
| 997 | * Filters the viewport meta in the admin. |
| 998 | * |
| 999 | * @since 5.5.0 |
| 1000 | * |
| 1001 | * @param string $viewport_meta The viewport meta. |
| 1002 | */ |
| 1003 | $viewport_meta = apply_filters( 'admin_viewport_meta', 'width=device-width,initial-scale=1.0' ); |
| 1004 | if ( empty( $viewport_meta ) ) { |
| 1005 | return; |
998 | 1006 | } |
| 1007 | echo '<meta name="viewport" content="' . esc_attr( $viewport_meta ) . '">'; |
| 1008 | } |
| 1009 | |
| 1010 | /** |
| 1011 | * Viewport meta for mobile in customize. |
| 1012 | * |
| 1013 | * Hooked to the {@see 'admin_viewport_meta'} filter. |
| 1014 | * |
| 1015 | * @since 5.5.0 |
| 1016 | */ |
| 1017 | function _customizer_mobile_viewport_meta( $content ) { |
| 1018 | return trim( $content, ',' ) . ',minimum-scale=0.5,maximum-scale=1.2'; |
999 | 1019 | } |
1000 | 1020 | |
1001 | 1021 | /** |