wp_shake_js() WordPress Function

The wp_shake_js() function is used to trigger a browser-specific "shake" effect. This is typically used to indicate an error condition to the user.

wp_shake_js() #

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


Source

File: wp-login.php

function wp_shake_js() {
	?>
	<script type="text/javascript">
	document.querySelector('form').classList.add('shake');
	</script>
	<?php
}

Top ↑

Changelog

Changelog
VersionDescription
3.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.