#732 closed defect (bug) (no action required)
Usage of bp-core-ajax-handler.php outside the member theme sets $is_member_page var to true
Reported by: | burtadsit | Owned by: | |
---|---|---|---|
Milestone: | Priority: | minor | |
Severity: | Version: | 1.0 | |
Component: | Keywords: | ||
Cc: |
Description
If code running on a blog takes advantage of bp's ajax handler, bp_core_set_uri_globals() arbitrarily sets the global $is_member_page var to true. That might not be the case if a widget or other code is running outside the member theme.
/* Catch a member page and set the current member ID */ if ( $bp_uri[0] == BP_MEMBERS_SLUG || in_array( 'bp-core-ajax-handler.php', $bp_uri ) ) { $is_member_page = true; $is_root_component = true;
I'm looking for a way to reliably determine if I'm in the member theme or not. I have a plugin that will run both inside and outside the member theme. Perhaps someone can give me some advice?
Change History (5)
#2
@
16 years ago
Yes, I'd see if $bp->displayed_user->id is set too.
in_array( 'bp-core-ajax-handler.php', $bp_uri ) ), so that looks like it should be safe to use. |
#3
@
16 years ago
if ( $bp_uri[0] == BP_MEMBERS_SLUG || in_array( 'bp-core-ajax-handler.php', $bp_uri ) ) {
even. Bloody formatting
Note: See
TracTickets for help on using
tickets.
Perhaps detecting if there is a $bp->displayed_user->id might be more reliable?