Set Short Automatic Logout Time for One User

One approach can be to log the time a user is logging in at by using: function user_last_login($user_login, $user) { update_user_meta($user – > ID, ‘last_login’, time()); } add_action(‘wp_login’, ‘user_last_login’, 10, 2); and then checking if the time is passed: add_action(‘get_header’, ‘processOnPageLoad’, 1 ); add_action(‘admin_init’, ‘processOnPageLoad’, 1 ); function processOnPageLoad() { if( is_user_logged_in() && condition_to_check_required_user ) … Read more

Logout without confirmation and SAME window on mobile

Try using wp_redirect($url). See https://developer.wordpress.org/reference/functions/wp_redirect/ . So…something like: // set up the URL to redirect to $redirect_to = ‘https://www.example.com/page’; wp_redirect($redirect_to); exit; Note that exit is required to close out the code. See the docs in the above link.

Use wp_logout_url() in menu creation page

Add submenu with a custom link, /wp-login?action=logout, like the image below: Add code like below in functions.php: function wpa_remove_menu_item( $items, $menu, $args ) { if ( is_admin() || ! is_user_logged_in() ) return $items; foreach ( $items as $key => $item ) { if ( ‘Login / Register’ == $item->title ) unset( $items[$key] ); if ( … Read more

Disallow second login session

The reason you’re not finding anything is because WordPress does not use any form of “sessions”. Login status information is not saved, or retrieved. Logging into WordPress basically sets a cookie in your browser which is a single authentication point. It is the equivalent of a username and password, with encryption and a timeout, all … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)