Category: Login
MemberPress: Change Username Field’s Placeholder and/or Label of the Field on Login Page
document.addEventListener(‘DOMContentLoaded’, function() { // Select the input element by its id var usernameInput = document.getElementById(‘user_login’); // Check if the element exists to avoid any potential JavaScript errors if (usernameInput) { // Change the placeholder text usernameInput.placeholder = ‘Username or Email’;…Continue reading
MemberPress: Redirect Users After Login Based on Referrer
// Redirect all users to a specific page after login from a specific login page function custom_mepr_login_redirect_url($url, $user) { // Check the referrer to see if the login request came from a specific page if (isset($_SERVER[‘HTTP_REFERER’])) { $referrer = $_SERVER[‘HTTP_REFERER’];…Continue reading
MemberPress: Redirect Users After Login Based on Roles
// Redirect users after login based on their roles function custom_mepr_login_redirect_url($url, $user) { // Check if the user object is valid if (isset($user->roles) && is_array($user->roles)) { // Roles that should be redirected to the WordPress dashboard $admin_roles = array(‘administrator’, ‘editor’,…Continue reading
MemberPress: Prevent users from auto-login after registration
function mepr_disable_auto_login($auto_login, $membership_id, $mepr_user) { return false; } add_filter(‘mepr-auto-login’, ‘mepr_disable_auto_login’, 10, 3);Continue reading
Lock users if website is idle for certain period ウェブサイトが一定期間アイドル状態の場合にユーザーをロックするAn updated version.
/** * Lock user out after a period of inactivity with customizable timeout and warning notification. */ // Add settings for inactivity timeout add_action(‘admin_init’, ‘register_inactivity_timeout_setting’); function register_inactivity_timeout_setting() { register_setting(‘general’, ‘inactivity_timeout’, [ ‘type’ => ‘integer’, ‘description’ => ‘Inactivity timeout duration in…Continue reading
*Block login after 3 failed attempts.
/** * Block login after 3 failed attempts. */ function block_login_after_three_attempts() { $login_lockout = get_option( ‘login_lockout’, array() ); // Get the user’s IP address. $user_ip = $_SERVER[‘REMOTE_ADDR’]; // Check if the user’s IP address is already in the lockout array.…Continue reading
Community Login Fluent Form – PHP
// Code Added by: Sumaiya, Clickup Doc: https://app.clickup.com/36636088/v/dc/12y1dr-22535/12y1dr-16835 add_action(‘fluentform/before_insert_submission’, function ($insertData, $data, $form) { if ($form -> id != 5) { return; } $redirectUrl = “https://community.inkontaktbringer.de/community/”; // You can change the redirect url after successful login // if you have…Continue reading
Remove the option to reset your password upon login
function remove_lost_password_link() { return ”; } add_filter( ‘gettext’, ‘remove_lost_password_link’, 10, 3 );Continue reading