can anyone give me some idea about how I can use the value of wp_logout_url()
within the menu creator page of wordpress? As the menu creation page doesn't support php I cannot just put echo wp_logout_url( home_url() )
under custom link.
Also I cannot use functions like
add_filter( 'wp_nav_menu_items', 'wti_loginout_menu_link', 10, 2 );
function wti_loginout_menu_link( $items, $args ) {
if ($args->theme_location == 'primary') {
if (is_user_logged_in()) {
$items .= '<li class="right"><a href="'. wp_logout_url() .'">Log Out</a></li>';
} else {
$items .= '<li class="right"><a href="'. wp_login_url(get_permalink()) .'">Log In</a></li>';
}
}
return $items;
}
because it doesn't fit my need, I have to add the logout link as a dropdown menu not as parent menu and also will show up in certain pages only. I can hel these things if anyone can show me the way how to fetch the wp_logout_url()
data within the wp menu creation page.
Any help is highly appreciated.