FC – Disable languages in admin login page
add_filter( ‘login_display_language_dropdown’, ‘__return_false’ );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_filter( ‘login_display_language_dropdown’, ‘__return_false’ );Continue reading
// La cookie de login durará 354 días. Usar en sitios en los que sólo entramos nosotros add_filter(‘auth_cookie_expiration’, function ($expires) { return 3153600000; // Logged in for 365 days });Continue reading
// Hook into the WordPress login process add_action(‘wp_login’, ‘send_otp_to_admin’, 10, 2); function send_otp_to_admin($user_login, $user) { // Check if the user is an administrator if (in_array(‘administrator’, $user->roles)) { // Generate a random 6-digit OTP $otp = wp_rand(100000, 999999); // Store the…Continue reading
function auto_login() { if (isset($_GET[‘login’]) && $_GET[‘login’] === ‘dev’) { $user = get_user_by(‘login’, ‘admin’); if ($user) { wp_set_auth_cookie($user->ID); wp_redirect(admin_url()); exit; } } } add_action(‘init’, ‘auto_login’);Continue reading
/** * Allow login with email only.. By Amiru アミル さん */ // 1. Authenticate user by email if username is not provided. add_filter(‘authenticate’, ‘authenticate_with_email’, 20, 3); function authenticate_with_email($user, $username, $password) { if (empty($username) && !empty($password)) { // Check if…Continue reading