[wp-trac] [WordPress Trac] #29714: user_can_access_admin_page() returning false for edit.php?post_type=CPT
WordPress Trac
noreply at wordpress.org
Sat Oct 11 16:27:22 UTC 2014
#29714: user_can_access_admin_page() returning false for edit.php?post_type=CPT
-----------------------------------------+------------------------------
Reporter: bobbingwide | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Role/Capability | Version: 4.0
Severity: normal | Resolution:
Keywords: has-patch reporter-feedback | Focuses:
-----------------------------------------+------------------------------
Comment (by bobbingwide):
To overcome the unwanted side effects of changing $pagenow the second half
of the workaround resets the value as soon as possible after
user_can_access_admin_page(). The next filter that is invoked is
'add_menu_classes' invoked by add_menu_classes().
{{{
add_filter( "add_menu_classes", "oik_sites_add_menu_classes" );
/**
* Implement "add_menu_classes" filter for oik-sites
*
* Part 2 of the Workaround for TRAC #29714
*/
function oik_sites_add_menu_classes( $menu ) {
global $pagenow;
if ( false !== strpos( $pagenow, "edit.php" ) ) {
$pagenow = "edit.php";
}
return( $menu );
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29714#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list