Skip to:
Content
Pages
Categories
Search
Top
Bottom

Check unread notification


  • johanmc
    Participant

    @johanmc

    Hi,
    to generate the list of notifications I use this code, but I need to verify which of the notifications have the status of not read.

    
    if (bp_has_notifications($args)) :
    
            while (bp_the_notifications()) : bp_the_notification();
    
                ob_start();
                bp_the_notification_description();
                $title[] = ob_get_contents();
                ob_end_clean();
    
                ob_start();
                bp_the_notification_time_since();
                $since[] = ob_get_contents();
                ob_end_clean();
    
            endwhile;
    
        endif;
    

    How can I get this status?

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)

  • shanebp
    Moderator

    @shanebp

    Did you look at the class in the codebase?
    The$is_new argument defaults to true, meaning only unread notifications are returned.

    By the way – using 2 output buffers in that loop is unnecessary.


    johanmc
    Participant

    @johanmc

    Hi @shanebp,

    Thanks for reply, i check the class in the codebase, but i want add class for css to unread notifications.

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