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

WordPress Trac noreply at wordpress.org
Mon May 6 17:25:17 UTC 2019


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

Comment (by BackuPs):

 To add more details to this.

 Your own coding example adds a extra list element this way at
 wordpress.org

 {{{#!php
 <?php
 wp_nav_menu( array(
     'theme_location' => 'primary',
     'items_wrap'     => '<ul><li id="item-id"><?php __( 'Menu:',
 'textdomain' ); ?></li>%3$s</ul>'
 ) );
 }}}

 To be found here.
 https://developer.wordpress.org/reference/functions/wp_nav_menu/

 However if you add a extra menu item with a url that url cannot be encoded
 because the  sprintf() function uses identifiers and a encoded url has
 codes that look like a identifier.

 Why is sprintf also acting on %3F? It should only acton on %3$s %2$s etc.

 How to work around this?

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


More information about the wp-trac mailing list