Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: another problem when it's a single item


grosbouff
Participant

@grosbouff

Here’s what I get when I print $bp in the code that ‘handles’ the navigation :

/classifieds/classified1234

[current_component] => classifieds [current_action] => [action_variables] => Array ( ) [current_item] => test11919 [is_single_item] => 1

/classifieds/classified1234/watch

[current_component] => classifieds [current_action] => watch [action_variables] => Array ( ) [current_item] => test11919 [is_single_item] => 1

When I print $bp in classifieds_screen_classified_home() :

/classifieds/classified1234

[current_component] => classifieds [current_action] => home [action_variables] => Array ( ) [current_item] => test11919 [is_single_item] => 1

/classifieds/classified1234/watch goes to profile page.

I still do not understand why classifieds_screen_classified_home isn’t “fired” when adding /watch since it still respond to the statement }else if ( $bp->is_single_item ) {.

I would rather prefer not do things like

if ($bp->current_component == $bp->classifieds->slug && $bp->current_action
&& 'watch' == $bp->action_vars[0]){

since it makes my code more complex.

I would prefer use

if (‘watch’ == $bp->action_vars[0]) inside my function classifieds_screen_classified_home…

Possible ?

Skip to toolbar