Make WordPress Core

Ticket #47369: 47369.3.diff

File 47369.3.diff, 3.2 KB (added by audrasjb, 22 months ago)

Patch refresh

  • src/wp-admin/admin-header.php

    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' ); ?>', 
    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

    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'; 
    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() ) {
    do_action( 'customize_controls_print_styles' ); 
    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.5.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

    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' ); 
    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

    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() { 
    988988}
    989989
    990990/**
    991  * @since 3.3.0
     991 * Displays the viewport meta in the admin.
     992 *
     993 * @since 5.5.0
    992994 */
    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
     995function 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;
    9981006        }
     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 */
     1017function _customizer_mobile_viewport_meta( $content ) {
     1018        return trim( $content, ',' ) . ',minimum-scale=0.5,maximum-scale=1.2';
    9991019}
    10001020
    10011021/**