You should use bp_is_component_front_page( 'activity' )
instead.
Thanks @r-a-y that does work for the front page, but bp_is_component_front_page( 'activity' )
or the one I just suggested bp_is_activity_front_page()
doesn’t seem to work correctly when using the activity parse args filter. The best solution I’ve got now is using ! bp_is_user() && bp_is_current_component( 'activity' )
This makes this work correctly:
/* Display just the activity updates for who the the logged-in
user is following and updates from the logged in user*/
function am_activity_filter( $retval ) {
if ( ! bp_is_user() && bp_is_current_component( 'activity' ) ) {
$retval['scope'] = 'following,just-me';
$retval['action'] = 'activity_update';
}
return $retval;
}
add_filter( 'bp_after_has_activities_parse_args', 'am_activity_filter' );
The problem with this conditional bp_is_component_front_page( 'activity' )
in my activity parse args filter is activity items keep showing from everyone instead of the items from who a user is following (I’m using your master follow plugin). The items that are not supposed to display, disappear when the user refreshes the page which makes the correct items display, but they keep coming back through the ‘load newest’. Have you tried this? Nevertheless ! bp_is_user() && bp_is_current_component( 'activity' )
is the one that is working correctly for this.
but bp_is_component_front_page( ‘activity’ ) or the one I just suggested bp_is_activity_front_page() doesn’t seem to work correctly when using the activity parse args filter.
bp_is_component_front_page( 'activity' )
is supposed to act as a replacement for front page checks, not for activity component checks.
If you’re checking for the activity directory page in bp_parse_args()
, then try using bp_is_activity_directory()
instead.
Iv’e got the activity directory page set as the front page, so I thought it would still work. bp_is_activity_directory() looks like the best one though. Thanks @r-a-y