using this code for post:
function filter_activities_by_registration_date( $args ) {
// Get the current user’s ID
$user_id = get_current_user_id();
// Check if the user is logged in
if ( ! $user_id ) {
return $args;
}
// Get the user's registration date
$user_data = get_userdata( $user_id );
$registration_date = $user_data->user_registered;
// Modify the activity query to filter posts after the registration date
$args['date_query'] = array(
array(
'after' => $registration_date,
'inclusive' => true, // Includes the registration date itself
),
);
return $args;
}
add_filter( ‘bp_before_has_activities_parse_args’, ‘filter_activities_by_registration_date’ );