Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: $bp->current_component problem in directory member view


Burt Adsit
Participant

@burtadsit

It’s a bug in function bp_core_set_uri_globals() in the file bp-core-catchuri.php. That var gets trashed when the directory is launched.

bp builds the vars $bp->current_component, $bp->current_action and $bp->action_variables for us but in case of emergency, like this, we still have $bp_unfiltered_uri which bp_core_set_uri_globals() builds for us. $bp_unfiltered_uri is an array of strings that is all the individual pieces of the url in sequence:

http://members/burtadsit/wire’ becomes:

array(3) { [0]=> string(7) “members” [1]=> string(5) “burtadsit” [2]=> string(4) “wire” }

So anywhere you really want to see what got you to some spot in bp, use:

global $bp_unfiltered_uri;

In the case of the directories the first element of the array is what you are looking for. So: $bp_unfiltered_uri[0] gets you what you want.

Skip to toolbar