I think the reason is echo vs return:
The function posts_logout_link from
http://plugins.svn.wordpress.org/logout-password-protected-posts/trunk/logout.php
is using echo.
Your code is therefore both returning and echoing values.
ps: You could consider using output buffering to fix this
ob_start();
do_action('posts_logout_link');
$logout_link=ob_get_clean();
return $menu . '<li>' . $logout_link . '</li>';
or modify the plugin code functions to your needs and place them into your functions.php file.
Related Posts:
- Add a logout menu link [duplicate]
- add the user name to menu when user is logged in [closed]
- wp_nav_menu log in/out link?
- Use wp_logout_url() in menu creation page
- How to Show Different Menus to Logged in Users in WordPress [duplicate]
- login logout menu changes in wordpress [closed]
- WordPress Login/Logout Single Menu Only
- How to add Loginout to Sub-menu
- How to make Logout Link consistently appear on all web pages?
- To Add Logout Button in Menu [duplicate]
- Display a portion/ branch of the menu tree using wp_nav_menu()
- Unregister Nav Menu from Child-Theme
- Display only page specific sub menu items using Custom Walker
- non-clickable placeholder in the menu
- Keeping parent menu items active in child pages
- Pass a parameter to a menu walker
- Menu is not visible in appearance
- Ways to give a wp_list_pages menu link specific class names?
- I want remove last after wp_nav_menu
- Organizing by super-categories (or nested categories)?
- Adding first and last class to Menu on top level only
- wp_list_pages – show pages immediately 1 level below current level
- Add within the output of
- How do I get my wp_nav_menu single category page to highlight the parent?
- Vertical Sidebar Menu Parent and Child not displaying correctly [closed]
- How to insert custom code into wp_nav_menu structure?
- How to add custom menu item on plugin activation?
- Outside the loop, how can I echo the current page’s menu title?
- getting parent page id when using custom menu.
- Use menu class in walker function
- Menu link to all posts (all categories included)
- How do you return a menu with the menu name?
- How to create this Custom Walker Menu
- create a 2 row menu in wordpress
- Get menu item by name or slug
- current-menu-item class is not added
- Change sub-menu contents of main menu
- wp_page_menu not working right?
- using OOP approach to create plugin but stuck at making hyperlinks to work
- creating a custom walker class
- Default menu editor with automatic page list
- Switch from hover to click on Twenty Twelve Menu
- How can I switch pages?
- How to override menu markup?
- Automatically Display Sub Menu
- Recent Posts widget missing current_menu_item class
- WordPress custom Nav Walker
- How to get a multidimensional array of my menu?
- How to get the name of the homepage’s menu?
- In admin edit-menu screen, newly added menu items always go to the bottom of the list
- How to add search to menu?
- How to get submenu of admin menu?
- How can I make wp_nav_menu() support tags?
- wp_nav_menu without menu or theme_location specified
- active menu in post page
- Adding a tag to wp_nav_menu
- What is the $menu parameter used of in wp_nav_menu()?
- Blending Foundation’s Tabs with WordPress Nav Menu & Display Active Tab
- select a main navigation menu per user type from multiple main navigation menus
- Editing the nav menu?
- Determining the “current_page” in WordPress Custom Menus
- Keep source page URL parameters on custom link menu item
- Menu elements load very slow
- cannot get global $menu value in form request
- How to remove empty line space in navigation menu?
- Is it possible to get_the_post_thumbnail (Featured Image) inside a sprintf function?
- is MariaDB error related to Automatically add new top-level pages
- Homepage Menu Link Won’t Function
- How to make a section id menu w/multiple pages
- Custom menu is rendered in all menus
- Disable Top Nav Bar on Mobile
- Making my main menu a hamburger menu on all platforms
- menu change after theme change
- Appearance –> Menu -not showing on my main page
- Menu location switcher – example code fails
- menu mobile show up even i in desktop mode in Newspaper Theme
- WordPress fountainpress header is covering top bar
- WordPress Menu Customizer
- Current menu item class issue
- Show post titles within WordPress bootstrap Dropdown menu
- Programmatically add a Navigation menu and menu items
- How to add class and span to
- Change header menu login-logout without changing main menu
- menu item active class for author.php
- Menu Structure with Links failure to update
- Is It Possible To A Link To The Homepage From The Admin Sidebar?
- My WordPress menu based on Twitter bootstrap creates menu-item and not page-item
- menu entries are lost
- menu items toggle and display on screen size reduction
- Cannot find Home link in Pages on Dashboard
- wp_nav_menu: indicate by id page grandparents
- How to get wordpress navigation to work
- Adding Sub Menu In a theme which Do not have Menu Options
- How do I show a different secondary navigation menu for each section of my website?
- Changing Menu Fonts Design [closed]
- How To Add Class To Style Search Box
- Unsual behaviour of navigation Menus
- Get Menu Items from REST API (React)
- Tried to hide navigation menu on one page ended up SCRAMBLING the navigation menu on another
- How to add a Year shortcode in wordpress Menu