Skip to:

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#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's profile burtadsit Owned by:
Milestone: Priority: minor
Severity: Version: 1.0
Component: Keywords:


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)

#1 @burtadsit
15 years ago

Perhaps detecting if there is a $bp->displayed_user->id might be more reliable?

#2 @DJPaul
15 years ago

Yes, I'd see if $bp->displayed_user->id is set too.

It is set in bp-core-catchuri.php if ( $bp_uri[0] == BP_MEMBERS_SLUG
in_array( 'bp-core-ajax-handler.php', $bp_uri ) ), so that looks like it should be safe to use.

#3 @DJPaul
15 years ago

if ( $bp_uri[0] == BP_MEMBERS_SLUG || in_array( 'bp-core-ajax-handler.php', $bp_uri ) ) {

even. Bloody formatting

#4 @apeatling
15 years ago

  • Resolution set to invalid
  • Status changed from new to closed

This file no longer exists in 1.0.1, can we take a look and see if this is still an issue?

#5 @(none)
15 years ago

  • Milestone Core 1.1 deleted

Milestone Core 1.1 deleted

Note: See TracTickets for help on using tickets.