[wp-trac] [WordPress Trac] #47139: function wp_logout_url urlencode causes issues in items wrap nav walker.

WordPress Trac noreply at wordpress.org
Fri Aug 2 11:09:52 UTC 2019


#47139: function wp_logout_url urlencode causes issues in items wrap nav walker.
-------------------------------+------------------------------
 Reporter:  BackuPs            |       Owner:  audrasjb
     Type:  defect (bug)       |      Status:  reviewing
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Menus              |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by BackuPs):

 Hi

 The example is in my initial report of the issue.

 Just try the following. But try this

 {{{#!php
 <?php
 $logout_url=wp_logout_url();

 // now call

                 return wp_nav_menu( array(
                                                 'theme_location' => 'top-
 menu',
                                                 'container' => 'nav',
                                                 'container_id' =>
 'navigation',
                                                 'container_class' =>
 'jqueryslidemenu',
                                                 'menu_id' => 'top-bar-
 menu',
                                                 'fallback_cb' => '',
                                                 'items_wrap'=>'<ul
 id="%1$s" class="%2$s">%3$s<li id="woo-menu-logon-xxxx" class="menu-item
 menu-item-type-post_type"><a href="'.$logout_url.'" title="Logout from
 shop">Logout</a></li></ul>',
                                         ));
 }}}



 Note: Change the theme_location to the correct menu location !

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47139#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list