wp_nav_menu log in/out link?
Use the wp_nav_menu_items hook to add a filter which will allow you to add your login / logout link. Use wp_loginout() to display a status aware login / logout link. Codex page.
Use the wp_nav_menu_items hook to add a filter which will allow you to add your login / logout link. Use wp_loginout() to display a status aware login / logout link. Codex page.
The issue is you pointing entirely unrelated (from WordPress point of view) domain to WP site. When WP processes logout the redirect is performed by wp_safe_redirect(), which disallows to redirect user “outside” the site. Since it has no clue about your custom domain that link is simply discarded. I would advise to properly set up … Read more
wp_get_current_user() will never work in this hook, because, wp_logout action fires after user is logged out: session destroyed, cookies cleared and current user is set to 0. But wp_logout action recieves $user_id. I will give you a working example, because I do not familiar with your custom functions. //pass $user_id as argument function mmd_JudgeLogoutCheck($user_id) { … Read more
After testing and reading the codes of WordPress. Here is the explanation of the phenomenon. Firstly, the following is nonce explanation and how it is going to affect the process. According to WordPress Nonces, A nonce is a “number used once” to help protect URLs and forms from certain types of misuse, malicious or otherwise. … Read more
Rarst said it worked for him both logged in and logged out, i can also confirm the same, here’s my ugly test code that works, very much just a hacked together version of your code(for testing). function say_coucou(){ check_ajax_referer( ‘hello’, ‘nonce’ ); echo “Hello”; die; } add_action(‘wp_ajax_hello_hello’, ‘say_coucou’); add_action(‘wp_ajax_nopriv_hello_hello’, ‘say_coucou’); add_action(‘admin_print_footer_scripts’,’blabla’,20000); add_action(‘wp_head’,’enj’,20000); add_action(‘wp_footer’,’blabla’,20000); function enj() … Read more
I’m using this as a custom logout button, it also displays a random quote before logout the user. I think you can adapt it to your needs by removing what you don’t need. Instructions: Copy the code below and save as users-logout.php Create a folder called users-logout, upload the file and the images below to … Read more
WordPress has hooks so you don’t need to actually remove wp-login.php. login_head fires before any HTML is rendered for the login form, and wp_logout fires after the login session has been destroyed. You can put this code in a custom plugin or in your theme’s functions.php file to let logout requests continue working but block … Read more
You have an errors in $items.= //Change Password, Logout, etc and $items.= //Sign up, Lost Password you haven`t value for assign.Set something into $items variable or delete this strings and all will work.
This message is raised by wp_nonce_ays() which is called by check_admin_referer(). Your browser has probably not sent a referer header, so WordPress could not validate the nonce. This may be a problem in your browser settings or your network connection.
To allow WordPress functions to operate outside of the WordPress environment, you need to let your external pages know about and have access to the WordPress Core and API environment. http://codex.wordpress.org/Integrating_WordPress_with_Your_Website The above link is one such reference which covers this very purpose. Specifically, In order to transform regular PHP pages into ones that utilize … Read more