Articles of logout

Preexisting login to change to logout link in sub menu

I am using twenty twelve with a child theme. I have a link in my primary nav menu where I have an link for “My Account” which has a sub menu with a “Login/Register” link that redirects to a modified wp-login.php. Is it possible for me to turn the “Login/Register” link into a “Logout” link […]

Is there any way to check for user login and send him to login?

I have written a plugin for my own site where I have an issue like “after user login to the site if he logout then again if he clicks on browser back button then the previous page showing again instead of login page”. for this issue I fixed it by using below js code: history.pushState(null, […]

How change wordpress password without logout ( need for plugin )

I need change WP password without logout profile. When I use wp_set_password( $password, $user_ID ) i have problem with logout.

Logout redirect to home page

I’m using custom menu for login/logout here below is my code: <li> <?php if (is_user_logged_in()) { $user = wp_get_current_user(); echo ‘Welcome <strong><a href=”” >’.$user->user_firstname.'</a></strong> | <a href=”;”>Logout</a>’; } else { ?> <strong><?php wp_loginout(); ?></strong> or <a href=”<?php bloginfo(‘url’) ?>/wp-login.php?action=register”> <strong>Register</strong></a> <?php }?> </li> but problem is : redirect to login page not current page… I […]

Logout user and delete cookies from the client side?

I’d like to be able to logout the user. I can do this by calling wp_logout() on the server but if the user drops connection is there a way to log them out? The wp_logout() method clears the cookies. Is there a way to do this on the client? Maybe like a clear all cookies […]

wp_logout action not working

I’m trying to remove some cookies set to control persistent login when the user specifically wants to log out of a website. I thought it would be as simple as: function remove_user_cookie() { unset($_COOKIE[‘woai’]); unset($_COOKIE[‘woak’]); } add_action(‘wp_logout’, ‘remove_user_cookie’); I’ve also tried: function remove_user_cookie() { if( $_GET[‘action’] == ‘logout’ ) : unset($_COOKIE[‘woai’]); unset($_COOKIE[‘woak’]); endif; } add_action(‘wp_logout’, […]

Custom Connect to Facebook, problem logging in/logging out

I am working on a custom function for login in my users via facebook. I started by reading this nice tutorial on how to login in via facebook: The function will log in the user to wordpress if an account with his/her facebook email already exists in the wordpress blog. If it doesnt exist, […]

WordPress Nonce Issue for Ajax Login and Logout

I am using ajax to submit log in and log out credentials. The log in and log out forms are replaced with html returned by a successful response. No page loading is happening page content is loaded via an ajax get request upon successful log in or log out. I can successfully log in and […]

wp_logout Not Logging Me Out

Here is what I’m doing: wp_logout(); var_dump(is_user_logged_in()); var_dump returns: bool(true) Why is wp_logout() not logging me out?

wp_nav_menu log in/out link?

I have a wp_nav_menu showing pages, but I’d also like to include a log in/out link, based on the current state of the user, which will redirect them to the home page. I’ve looked far and wide, but how can I implement this in a wp_nav_menu? Thanks, Dennis