Community Support Forums — WordPress® ( Users Helping Users ) — 2011-11-21T03:24:37-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=15961 2011-11-21T03:24:37-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15961&p=53592#p53592 <![CDATA[Re: Adding a log in / log out link to menu]]>
Code:
wp_loginout('index.php'); 


That's telling it to redirect_to index.php after each login or logout, so this would prevent the user from being shown the Login Welcome page after login, for example. http://www.s2member.com/login-welcome-p ... cts-video/

Statistics: Posted by Cristián Lávaque — November 21st, 2011, 3:24 am


]]>
2011-11-18T21:55:01-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15961&p=53449#p53449 <![CDATA[Adding a log in / log out link to menu]]>
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 .= '<li>'. $loginoutlink .'</li>';

return $items;
}

It successfully added a log in / log out link to my menu. However, it does not adhere to the same login redirect rules that the s2member pro login widget adheres to. Has anyone attempted this?

Statistics: Posted by qblearning — November 18th, 2011, 9:55 pm


]]>