Plugin, beproefd en in gebruik (check feb 2019)

Simple Login-Logout Shortcode

A single shortcode you can place anywhere to allow visitors to login/logout.

[login-logout text_to_login="Login" text_to_logout="Logout" class="custom-class" redirect="/shop/"]

 

Ik plaatste het helemaal rechts in de menubalk met deze code in de functions.php

add_filter('widget_text', 'do_shortcode');
add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2);
function add_login_logout_link($items, $args) {
ob_start();
wp_loginout('index.php');
$loginoutlink = ob_get_contents();
ob_end_clean();
$items .= '

  • '. $loginoutlink .'

';
return $items;
}