Changeset 48412
- Timestamp:
- 07/09/2020 11:27:28 PM (4 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/admin-header.php
r48083 r48412 91 91 isRtl = <?php echo (int) is_rtl(); ?>; 92 92 </script> 93 <meta name="viewport" content="width=device-width,initial-scale=1.0">94 93 <?php 95 94 -
trunk/src/wp-admin/customize.php
r48111 r48412 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 … … 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> -
trunk/src/wp-admin/includes/admin-filters.php
r48288 r48412 45 45 add_action( 'admin_head', 'wp_color_scheme_settings' ); 46 46 add_action( 'admin_head', 'wp_site_icon' ); 47 add_action( 'admin_head', '_ipad_meta' ); 47 add_action( 'admin_head', 'wp_admin_viewport_meta' ); 48 add_action( 'customize_controls_head', 'wp_admin_viewport_meta' ); 48 49 49 50 // Prerendering. -
trunk/src/wp-admin/includes/misc.php
r48345 r48412 1015 1015 1016 1016 /** 1017 * @since 3.3.0 1018 */ 1019 function _ipad_meta() { 1020 if ( wp_is_mobile() ) { 1021 ?> 1022 <meta name="viewport" id="viewport-meta" content="width=device-width, initial-scale=1"> 1023 <?php 1024 } 1017 * Displays the viewport meta in the admin. 1018 * 1019 * @since 5.5.0 1020 */ 1021 function wp_admin_viewport_meta() { 1022 /** 1023 * Filters the viewport meta in the admin. 1024 * 1025 * @since 5.5.0 1026 * 1027 * @param string $viewport_meta The viewport meta. 1028 */ 1029 $viewport_meta = apply_filters( 'admin_viewport_meta', 'width=device-width,initial-scale=1.0' ); 1030 if ( empty( $viewport_meta ) ) { 1031 return; 1032 } 1033 echo '<meta name="viewport" content="' . esc_attr( $viewport_meta ) . '">'; 1034 } 1035 1036 /** 1037 * Viewport meta for mobile in customize. 1038 * 1039 * Hooked to the {@see 'admin_viewport_meta'} filter. 1040 * 1041 * @since 5.5.0 1042 */ 1043 function _customizer_mobile_viewport_meta( $content ) { 1044 return trim( $content, ',' ) . ',minimum-scale=0.5,maximum-scale=1.2'; 1025 1045 } 1026 1046
Note: See TracChangeset
for help on using the changeset viewer.