• Hi BuddyPress support,

    I’m using your plugin and encountering an issue. When a new student enrolls in a course, I want them to only receive messages and posts starting from their enrollment date, not previous ones. I’ve managed to resolve the issue with the posts, but I’m having trouble with the messages. Could you assist me with this?

    Thank you!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ashekurrahman1

    (@ashekurrahman1)

    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’ );

    Plugin Support Jarryd Long

    (@jarryd-long)

    Hi there, thank you for reaching out to the Paid Memberships Pro team.

    Just to confirm do you still need assistance with this as you have code running there to adjust the activity?

    Kind Regards,
    Jarryd
    Support Manager at Paid Memberships Pro

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.