[wp-trac] [WordPress Trac] #28226: menu_page_url does not return correct URL on network admin
WordPress Trac
noreply at wordpress.org
Tue May 13 19:35:03 UTC 2014
#28226: menu_page_url does not return correct URL on network admin
-------------------------------------------------+-------------------------
Reporter: norcross | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.0
Component: Menus | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch dev-feedback 2nd-opinion | Focuses: multisite
needs-testing |
-------------------------------------------------+-------------------------
Changes (by Denis-de-Bernardy):
* version: 3.0 => trunk
Comment:
Either patch seem wrong though: the function is supposed to return the
menu url of a page registered by a plugin. The current implementation is
correct provided the menu page is not in user admin or in network.
The first patch seems incorrect, plain and simple. Same for the third one,
though I'm less sure. Basically, if you're in e.g. the network admin and
you call the function to get a menu page url that is registered for the
blog admin, you'll get the url of the page for the network admin instead
of the expected urlinthe blog admin.
The second patch yields the correct url but is missing the same function
for the user admin area.
Methinks the ideal would be for menu_page_url() to conditionally yield the
correct url, not based on whether you're in the blog, network or user
admin area, but based on whether the menu page is registered in the blog,
network or user admin area. But then, are these menu items even registered
with the relevant context in the globals?
cc @nacin, as core dev input is needed here imho.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28226#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list