Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Changing login error message (wp-admin)
<?php
// Insert into your functions.php and have fun creating login error msgs
function guwp_error_msgs() {
// insert how many msgs you want as an array item. it will be shown randomly
$custom_error_msgs = array(
'<strong>YOU</strong> SHALL NOT PASS!',
'<strong>HEY!</strong> GET OUT OF HERE!',
);
// get random array item to show
return $custom_error_msgs[array_rand($custom_error_msgs)];;
}
add_filter( 'login_errors', 'guwp_error_msgs' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment