-
-
Save fervous/abfdbcbbb9b759506fbbed8785419db5 to your computer and use it in GitHub Desktop.
BuddyPress Show if User has New Private Messages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This code goes into one of the WC Vendors Templates. Which one? Depends where you want to show it on the dashboard. :) */ | |
/* Shows unread messages button */ | |
$unread = bp_get_total_unread_messages_count(); | |
$current_user = wp_get_current_user(); | |
if ( $unread > 0 ) { | |
echo '<a href="/members/' . $current_user->user_login . '/messages/">You have ' . $unread . ' Unread Private Messages</a>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment