I came up with a solution to rewrite ‘href’ of the $wp_admin_bar->get_node(‘logout’) through functions.php.
So, users will never see the actual slug anymore and will never get any cookie from ithemes security in this case, since only the social login is active.
If you know a better solution, please let me know, but it works how I wanted.
-
This reply was modified 7 years, 10 months ago by
nikolask1.
@nikolask1,
I am concerned about this on logout, as well, and especially since one user was locked out attempting to login using the login slug I created.
Will you explain further please, your solution. I am in my functions.php and searched for words used in your solution and only found ‘href’. I don’t know what I’m doing and need a bit of clarification (more details).
Thank you kindly.
Regards…
Hi @jhazzi,
Sure, I added some lines into the functions.php:
function logout_render($wp_admin_bar) {
$logoutNode = $wp_admin_bar->get_node('logout');
$newHref = wp_logout_url(get_permalink());
$pattern = '/itsec-hb-token=.*&/U';
$newHref = preg_replace($pattern, '', $newHref);
$newHref = str_replace('amp;', '', $newHref);
$logoutNode->href = $newHref;
$wp_admin_bar->add_node($logoutNode);
}
add_action( 'admin_bar_menu', 'logout_render', 80 );
I hope that it will help you as well 🙂
-
This reply was modified 7 years, 8 months ago by
nikolask1.
@nikolask1
Thank you so very much! I am sure it will help me, as well. 🙂
Enjoy your weekend!