Reply To: Conditional no longer working – is_front_page() for activity front page
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.