[buddypress-trac] [BuddyPress Trac] #5843: WP_Screen may be null if remove_signups_from_user_query is called from within admin_init hook
buddypress-trac
noreply at wordpress.org
Thu Aug 28 13:24:33 UTC 2014
#5843: WP_Screen may be null if remove_signups_from_user_query is called from
within admin_init hook
----------------------------+------------------------------
Reporter: pauldewouters | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version: 2.0
Severity: normal | Resolution:
Keywords: dev-feedback |
----------------------------+------------------------------
Comment (by boonebgorges):
Thanks for the report.
Checking for `doing_action( 'admin_init' )` seems overly specific to me.
Let's just change our syntax a little bit:
{{{
// Bail if not on a users page
$current_screen = get_current_screen();
if ( ! isset( $current_screen->id ) || $this->users_page !==
$current_screen->id ) {
return;
}
}}}
Will that work?
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5843#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list