BuddyDev

Search

[Resolved] count all notifications

  • Participant
    Level: Enlightened
    Posts: 36
    rav on #25840

    Hi BuddyDev,
    Is there a function that returns all notifications so you can count how many notifications you have, both read and unread?
    I know how to get “count” from unread notifications. But how can I count the notifications I read?

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #25852

    Hi Rav,
    Thank you for the question.

    Please use the following code.

    
    
    $read_count = BP_Notifications_Notification::get_total_count( array(
    	'user_id' => bp_loggedin_user_id(),
    	'is_new'  => 0,
    ) );
    
    

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 36
    rav on #25859

    Hi Brajesh Singh,
    This is what I was looking for.
    Thank you very much

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #25870

    You are welcome.

The topic ‘ [Resolved] count all notifications’ is closed to new replies.

This topic is: resolved