wp_shake_js()

Outputs the JavaScript to handle the form shaking on the login page.

Source

function wp_shake_js() {
	wp_print_inline_script_tag( "document.querySelector('form').classList.add('shake');" );
}

Changelog

VersionDescription
3.0.0Introduced.

User Contributed Notes

  1. Skip to note 4 content

    Remove the Login Page Shake.
    The login form shakes when the user submits the wrong login credentials; if you don’t want this feature, you can remove using:

    function wpdocs_remove_login_shake() {
    	remove_action( 'login_head', 'wp_shake_js', 12 );
    }
    add_action( 'login_head', 'wpdocs_remove_login_shake' );

You must log in before being able to contribute a note or feedback.