Created
January 6, 2021 12:45
-
-
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
This file contains hidden or 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
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