Creating a Login Logout Programatically

Creating a Login Logout Programatically
add_filter( 'wp_nav_menu_items', 'kd_conditional_nav_items', 10, 2 );
function kd_conditional_nav_items( $menu, $args ) {
    if ( 'other-links' == $args->menu ) {
		if ( is_user_logged_in() ) {
			$menu .= '';
		} else {
			$menu .= '';
		}
        return $menu;
    }
   
    return $menu;
}
add_action('wp_logout','kd_redirect_after_logout');
function kd_redirect_after_logout(){
     wp_redirect( get_field('login_logout_url','option') );
     exit();
}

screen67

screen68

Leave a Reply

Your email address will not be published. Required fields are marked *