Skip to content

Instantly share code, notes, and snippets.

@nikitasinelnikov
Created January 6, 2021 12:45
Show Gist options
  • Save nikitasinelnikov/a9d59af016c2385732e500261f451604 to your computer and use it in GitHub Desktop.
Save nikitasinelnikov/a9d59af016c2385732e500261f451604 to your computer and use it in GitHub Desktop.
UM: Private Messages - Check if the users have conversations between theirselves and show this marker in profile header
function um_custom_markers( $args ) {
if ( is_user_logged_in() && ! empty( UM()->Messaging_API() ) ) {
if ( um_profile( 'ID' ) != get_current_user_id() &&
! empty( UM()->Messaging_API()->api()->get_conversation_id( um_profile( 'ID' ), get_current_user_id() ) ) {
echo 'some HTML with marker';
}
}
}
add_action( 'um_profile_header', 'um_custom_markers', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment