Skip to:
Content
Pages
Categories
Search
Top
Bottom

Messages not loading for administrators


  • mikeavena
    Participant

    @mikeavena

    I’m trying to create a theme with a messages notification/box in the header. So far, everything works fine for regular users. However, if logged in as an administrator, bp_has_message_threads() will return nothing, even if the user has messages. This only happens on non-profile pages – if you navigate to a user profile (buddypress page), the message appear as expected. My best guess is the profile pages are executing some function that I’m not? Here’s the loop I created:

    if(bp_has_message_threads(array('max' => 5)))
    							{
    								// TODO: put buttons 'mark all as read' and 'go to inbox'
    								
    								while(bp_message_threads())
    								{
    									bp_message_thread();
    									printf('<div class="dropdown-divider"></div>');
    									printf('<a href="%1$s" class="dropdown-item">%2$s...<br>From: %3$s</a>',
    											bp_get_message_thread_view_link(),
    											bp_get_message_thread_excerpt(),
    											wp_strip_all_tags(bp_get_message_thread_from()));
    								}
    								
    								printf('<div class="dropdown-divider"></div>');
    								printf('<a href="%1$smessages" class="dropdown-item">See all messages...</a>', bp_loggedin_user_domain());
    							}
    							else
    							{
    								// If users has no unread messages, tell them and give a link to their full inbox
    								printf('<a href="%1$smessages" class="dropdown-item">You have no messages</a>', bp_loggedin_user_domain());
    							}
  • You must be logged in to reply to this topic.
Skip to toolbar