Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Mensagens de erro de login (wp-admin)
* Plugin Name: Mensagens de erro de login
* Description: Mensagens aleatórios e personalizadas para tentativas fracassadas de login.
* Version: 1.1
* Author: LFreitas based on Sergio Costa (zergiocosta)
* Text Domain: custom-error-msgs
* source:
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
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!',
'Did you bring a <strong>shrubbery</strong>?',
// get random array item to show
return $custom_error_msgs[array_rand($custom_error_msgs)];;
add_filter( 'login_errors', 'guwp_error_msgs' );

This comment has been minimized.

Copy link
Owner Author

@lillyfreitas lillyfreitas commented Nov 6, 2017

Instead of changing in the functions.php, include as a site-specific plugin.
The file must be in /wp-content/plugins/ and the plugin must be active via WP Dashboard.

Em vez de editar o functions.php, colocar como um plugin personalizado.
O arquivo deve estar na pasta /wp-content/plugins/ e o plugin deve ser ativado pelo Painel do WP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment