Hi, everybody!
I want to put a logout button or link in the top menu.
I’ve searched the wordpress.org site but I didn’t see clearly the way to do it.
When I tried to get a logout & redirect to homepage link putting <a href="<?php echo wp_logout_url( home_url() ); ?>" title="Logout">Logout</a>
in the WP menu url field, and click Save Menu, the Menu rewrite ahref and become useless.
Then, I found this as example and I think that I have to put it in enfold-child theme functions
add_filter('allowed_redirect_hosts','allow_ms_parent_redirect');
function allow_ms_parent_redirect($allowed)
{
$allowed[] = 'multisiteparent.com';
return $allowed;
}
<a href="<?php echo wp_logout_url( 'http://multisiteparent.com' ); ?>" title="Logout">Logout</a>
How can I get it?
Thanks!
Best regards!
Affaire solved with one plugin that works perfectly, at least for me. Share for people with the same question:
https://wordpress.org/plugins/baw-login-logout-menu/
Gracias