you can redirect logged out users from activity page to home (or any page you prefer) using this function
function restrict_activity_page_from_logged_out_users(){
global $bp;
if( $bp->current_component === 'activity' && !is_user_logged_in() )
bp_core_redirect( site_url() ); // for home page; or use wp_login_url() to redirect to login page
exit;
}
add_action('wp','restrict_activity_page_from_logged_out_users');
Remove the link:
function dono_remove_view_link( $latest_update ) {
if ( ! is_user_logged_in() ) {
$text = preg_replace('/<a href=\"(.*?)\">(.*?)<\/a>/', "\\2", $latest_update);
$link_text = esc_attr__( 'View', 'buddypress' );
$latest_update = rtrim($text, $link_text);
}
return $latest_update;
}
add_filter( 'bp_get_activity_latest_update', 'dono_remove_view_link', 1, 100 );
Thanks Rimon and Shane bp for your reply.
Shanebp your solution is the one I’m looking for except it doesn’t seem to have any affect. I tried the function first in bp_custom and then in funtions.php both didn’t work. What am I missing?
It worked on my install. In bp-custom.
Were you logged out when you tried it?
Yes. I might add I have bbpress child theme don’t think that should matter