mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-13 21:30:26 +00:00
Administration: Remove multiple viewport meta tags from mobile pages.
In addition, add the `wp_admin_viewport_meta()` function, paired to the `admin_viewport_meta` filter to control attributes of the meta tag. Fixes #47369. Props BettyJJ, mukesh27, SergeyBiryukov, ajayghaghretiya1, msaggiorato, talldanwp, davidbaumwald, donmhico, audrasjb. git-svn-id: https://develop.svn.wordpress.org/trunk@48412 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1014,14 +1014,34 @@ function wp_color_scheme_settings() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.3.0
|
||||
* Displays the viewport meta in the admin.
|
||||
*
|
||||
* @since 5.5.0
|
||||
*/
|
||||
function _ipad_meta() {
|
||||
if ( wp_is_mobile() ) {
|
||||
?>
|
||||
<meta name="viewport" id="viewport-meta" content="width=device-width, initial-scale=1">
|
||||
<?php
|
||||
function wp_admin_viewport_meta() {
|
||||
/**
|
||||
* Filters the viewport meta in the admin.
|
||||
*
|
||||
* @since 5.5.0
|
||||
*
|
||||
* @param string $viewport_meta The viewport meta.
|
||||
*/
|
||||
$viewport_meta = apply_filters( 'admin_viewport_meta', 'width=device-width,initial-scale=1.0' );
|
||||
if ( empty( $viewport_meta ) ) {
|
||||
return;
|
||||
}
|
||||
echo '<meta name="viewport" content="' . esc_attr( $viewport_meta ) . '">';
|
||||
}
|
||||
|
||||
/**
|
||||
* Viewport meta for mobile in customize.
|
||||
*
|
||||
* Hooked to the {@see 'admin_viewport_meta'} filter.
|
||||
*
|
||||
* @since 5.5.0
|
||||
*/
|
||||
function _customizer_mobile_viewport_meta( $content ) {
|
||||
return trim( $content, ',' ) . ',minimum-scale=0.5,maximum-scale=1.2';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user