Login: Don't rely on `wp_is_mobile()` for functionality.

Making behavior changes based on some broad definition of what mobile is rarely, if ever, makes sense. Each bit of functionality should be more clearly targeted, whether that's for screen size, performance, or some kind of touch capability.

props akibjorklund.
see #33704.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Helen Hou-Sandí 2016-10-06 15:52:30 +00:00
parent 0438d27410
commit e4bfe48ebc
6 changed files with 16 additions and 35 deletions

View File

@ -216,19 +216,6 @@ p {
width: 100%;
}
.mobile #login {
padding: 20px 0;
}
.mobile #login form {
margin-right: 0;
}
.mobile #login #nav,
.mobile #login #backtoblog {
margin-right: 8px;
}
body.interim-login {
height: auto;
}
@ -255,6 +242,12 @@ body.interim-login {
width: device-width;
}
@media screen and ( max-height: 550px ) {
#login {
padding: 20px 0;
}
}
@media screen and ( max-width: 782px ) {
.interim-login input[type=checkbox] {
height: 16px;

File diff suppressed because one or more lines are too long

View File

@ -216,19 +216,6 @@ p {
width: 100%;
}
.mobile #login {
padding: 20px 0;
}
.mobile #login form {
margin-left: 0;
}
.mobile #login #nav,
.mobile #login #backtoblog {
margin-left: 8px;
}
body.interim-login {
height: auto;
}
@ -255,6 +242,12 @@ body.interim-login {
width: device-width;
}
@media screen and ( max-height: 550px ) {
#login {
padding: 20px 0;
}
}
@media screen and ( max-width: 782px ) {
.interim-login input[type=checkbox] {
height: 16px;

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.7-alpha-38738';
$wp_version = '4.7-alpha-38739';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -36,8 +36,7 @@ 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' );
add_action( 'login_head', 'wp_login_viewport_meta' );
if ( empty($wp_error) )
$wp_error = new WP_Error();
@ -124,8 +123,6 @@ function login_header( $title = 'Log In', $message = '', $wp_error = '' ) {
$login_header_title = apply_filters( 'login_headertitle', $login_header_title );
$classes = array( 'login-action-' . $action, 'wp-core-ui' );
if ( wp_is_mobile() )
$classes[] = 'mobile';
if ( is_rtl() )
$classes[] = 'rtl';
if ( $interim_login ) {
@ -260,8 +257,6 @@ function login_footer($input_id = '') {
* @since 3.0.0
*/
function wp_shake_js() {
if ( wp_is_mobile() )
return;
?>
<script type="text/javascript">
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};