Make WordPress Core

Ticket #47369: 47369.diff

File 47369.diff, 2.7 KB (added by msaggiorato, 3 years ago)
  • src/wp-admin/admin-header.php

     
    9191        decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
    9292        isRtl = <?php echo (int) is_rtl(); ?>;
    9393</script>
    94 <meta name="viewport" content="width=device-width,initial-scale=1.0">
    9594<?php
    9695
    9796/**
  • src/wp-admin/customize.php

     
    132132
    133133if ( wp_is_mobile() ) :
    134134        $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' );
    139136endif;
    140137
    141138if ( $wp_customize->is_ios() ) {
     
    171168 * @since 3.4.0
    172169 */
    173170do_action( 'customize_controls_print_scripts' );
     171
     172/**
     173 * Fires when Customizer control scripts are printed.
     174 *
     175 * @since 5.3.0
     176 */
     177do_action( 'customize_controls_head' );
    174178?>
    175179</head>
    176180<body class="<?php echo esc_attr( $body_class ); ?>">
  • src/wp-admin/includes/admin-filters.php

     
    4343add_action( 'admin_head', 'wp_admin_canonical_url' );
    4444add_action( 'admin_head', 'wp_color_scheme_settings' );
    4545add_action( 'admin_head', 'wp_site_icon' );
    46 add_action( 'admin_head', '_ipad_meta' );
     46add_action( 'admin_head', 'wp_admin_viewport_meta' );
     47add_action( 'customize_controls_head', 'wp_admin_viewport_meta' );
    4748
    4849// Prerendering.
    4950if ( ! is_customize_preview() ) {
  • src/wp-admin/includes/misc.php

     
    939939}
    940940
    941941/**
    942  * @since 3.3.0
     942 * @since 5.3.0
    943943 */
    944 function _ipad_meta() {
    945         if ( wp_is_mobile() ) {
     944function wp_admin_viewport_meta() {
     945        $viewport_meta = apply_filters( 'admin_viewport_meta', 'width=device-width,initial-scale=1.0' );
     946        if ( ! empty( $viewport_meta ) ) :
    946947                ?>
    947                 <meta name="viewport" id="viewport-meta" content="width=device-width, initial-scale=1">
     948                <meta name="viewport" id="viewport-meta" content="<?php echo esc_attr( $viewport_meta ); ?>">
    948949                <?php
    949         }
     950        endif;
     951}
     952
     953/**
     954 * @since 5.3.0
     955 */
     956function _customizer_mobile_viewport_meta( $content ) {
     957        return trim( $content, ',' ) . ',minimum-scale=0.5,maximum-scale=1.2';
    950958}
    951959
    952960/**