If I add [wpv-logout-link] in the URL field, it doesn't work. And if I add /wp-login.php?action=logout&redirect_to=/my-account/ in the URL field, it does work, but it asks for the confirmation.
Is there anyway to create a logout link that logs out the user directly, without asking for their confirmation.
Hello and thank you for contacting the Toolset support.
By default, WordPress will not evaluate shortcodes inside the menus. Toolset does not actually have any effects on menus. However, you can run a shortcode inside a menu using a 3rd party plugin such as https://wordpress.org/plugins/shortcode-in-menus/
First, if WP can't find a valid wpnounce parameter & value in the logout URL, it will display the logout confirmation page. The above code adds the necessary wpnounce parameter & value on the fly.
The next part is adding the logout URL in the menu item or wherever. The logout URL should be:
"/wp-login.php?action=logout"
That's it.
This code can be added in theme's function.php file or in a plugin like Code Snippets.