[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:02:21 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: Core | Version:
Severity: normal | Keywords:
---------------------------+-----------------------------
Referencing this forum thread: http://buddypress.org/support/topic
/conflict-with-my-plugin/#post-188636
The function `remove_signups_from_user_query` in `bp-members-admin.php`
makes a call to `get_current_screen()`
This function will return `null` if in the context of a function hooked to
`admin_init`
In this case, a plugin I developed is running a `WP_User_Query` on
`admin_init` so the `pre_user_query` gets fired and this fires the
`remove_signups_from_user_query` function.
Method could check for `admin_init` like so:
`if ( doing_action( 'admin_init' ) || $this->users_page !=
get_current_screen()->id ) { return;}`
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5843>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list