[wp-trac] [WordPress Trac] #12453: _wp_menu_output() needs to use add_query_arg()
WordPress Trac
wp-trac at lists.automattic.com
Tue Mar 2 14:04:45 UTC 2010
#12453: _wp_menu_output() needs to use add_query_arg()
--------------------------+-------------------------------------------------
Reporter: TobiasBg | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.0
Component: Post Types | Version:
Severity: normal | Keywords: needs-patch
--------------------------+-------------------------------------------------
Comment(by TobiasBg):
I attached a patch that fixes the links in the admin menu, by using
add_query_arg, however there seems to remain a problem with user rights,
as I now get redirected to /wp-admin/?c=1 when clicking /wp-
admin/edit.php?post_type=page&page=demo-plugin-slug (with above demo
plugin installed)
Details for the patch:
- Changes {{{strcmp(...) == 0}}} comparison to plain {{{$string1 ==
$string2}}} comparison
- uses {{{add_query_arg}}} to generate URLs (which remedies the problem of
two ? in the URL)
- fixes the if/ifelse/else logic, as the else part was never called, as
either the first ( {{{if $parent_exists}}} ) or the second condition (
{{{if !$parent_exists}}} ) are always fulfilled.
- $parent_exists is now longer necessary, so I removed it and put the
condition into the if-clause
What's left: The links in the menu are looking ok now, but are not
accessible (wp_redirect() to /wp-admin/?c=1), most probably coming from
somewhere in /wp-admin/menu.php.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12453#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list