Simplify the login page viewport meta for mobile devices, so it's less restrictive on the user. Allows for developers to override if necessary via the `login_head` action. props azaozz. fixes #24777.

Built from https://develop.svn.wordpress.org/trunk@25619


git-svn-id: http://core.svn.wordpress.org/trunk@25536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Helen Hou-Sandí 2013-09-25 15:20:09 +00:00
parent d50200d84d
commit 77a7702deb
1 changed files with 9 additions and 4 deletions

View File

@ -44,6 +44,9 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') {
// Don't index any of these forms
add_action( 'login_head', 'wp_no_robots' );
if ( wp_is_mobile() )
add_action( 'login_head', 'wp_login_viewport_meta' );
if ( empty($wp_error) )
$wp_error = new WP_Error();
@ -64,10 +67,6 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') {
wp_admin_css( 'wp-admin', true );
wp_admin_css( 'colors-fresh', true );
if ( wp_is_mobile() ) { ?>
<meta name="viewport" content="width=320, initial-scale=0.9, maximum-scale=1.0, user-scalable=0" /><?php
}
// Remove all stored post data on logging out.
// This could be added by add_action('login_head'...) like wp_shake_js()
// but maybe better if it's not removable by plugins
@ -189,6 +188,12 @@ addLoadEvent(function(){ var p=new Array(15,30,15,0,-15,-30,-15,0);p=p.concat(p.
<?php
}
function wp_login_viewport_meta() {
?>
<meta name="viewport" content="width=device-width" />
<?php
}
/**
* Handles sending password retrieval email to user.
*