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
add_action('um_after_user_role_is_updated', 'mycustom_role_change_action', 10, 2 ); | |
function mycustom_role_change_action( $user_id, $new_role ) { | |
if ( $new_role == 'admin' ) { | |
die('You can not be a community admin'); | |
} | |
} |
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
global $um_messaging; | |
$user_id = 'xx'; // enter user id here | |
$count = $um_messaging->api->get_unread_count( $user_id ); | |
echo $count; |
OlderNewer