[wp-trac] [WordPress Trac] #19248: menu_page_url() should return unencoded URL, and echo encoded URL

WordPress Trac wp-trac at lists.automattic.com
Tue Nov 15 19:38:03 UTC 2011


#19248: menu_page_url() should return unencoded URL, and echo encoded URL
--------------------------+------------------------------
 Reporter:  nathanrice    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Plugins       |     Version:  3.0
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------

Comment (by nathanrice):

 Replying to [comment:2 westi]:
 > Can you not get the url for the settings menu by using the result of
 add_settings_page(...) as the slug you pass to menu_page_url to solve your
 usecase ?

 I could, but that doesn't solve the issue. `menu_page_url()` returns an
 escaped URL. `add_query_arg()` barfs when you pass it an escaped URL. So,
 either we're OK with these two functions NOT being able to work together,
 or we need to find a way to fix it. As it stands, you cannot take the
 result of `menu_page_url()` and pass it to `add_query_arg()`.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19248#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list