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. git-svn-id: https://develop.svn.wordpress.org/trunk@38739 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
57a80e2c84
commit
7cc095a1a0
|
@ -216,19 +216,6 @@ p {
|
||||||
width: 100%;
|
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 {
|
body.interim-login {
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
@ -255,6 +242,12 @@ body.interim-login {
|
||||||
width: device-width;
|
width: device-width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and ( max-height: 550px ) {
|
||||||
|
#login {
|
||||||
|
padding: 20px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and ( max-width: 782px ) {
|
@media screen and ( max-width: 782px ) {
|
||||||
.interim-login input[type=checkbox] {
|
.interim-login input[type=checkbox] {
|
||||||
height: 16px;
|
height: 16px;
|
||||||
|
|
|
@ -36,8 +36,7 @@ function login_header( $title = 'Log In', $message = '', $wp_error = '' ) {
|
||||||
// Don't index any of these forms
|
// Don't index any of these forms
|
||||||
add_action( 'login_head', 'wp_no_robots' );
|
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) )
|
if ( empty($wp_error) )
|
||||||
$wp_error = new 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 );
|
$login_header_title = apply_filters( 'login_headertitle', $login_header_title );
|
||||||
|
|
||||||
$classes = array( 'login-action-' . $action, 'wp-core-ui' );
|
$classes = array( 'login-action-' . $action, 'wp-core-ui' );
|
||||||
if ( wp_is_mobile() )
|
|
||||||
$classes[] = 'mobile';
|
|
||||||
if ( is_rtl() )
|
if ( is_rtl() )
|
||||||
$classes[] = 'rtl';
|
$classes[] = 'rtl';
|
||||||
if ( $interim_login ) {
|
if ( $interim_login ) {
|
||||||
|
@ -260,8 +257,6 @@ function login_footer($input_id = '') {
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*/
|
*/
|
||||||
function wp_shake_js() {
|
function wp_shake_js() {
|
||||||
if ( wp_is_mobile() )
|
|
||||||
return;
|
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<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();}}};
|
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();}}};
|
||||||
|
|
Loading…
Reference in New Issue