• I’m trying to find a way to access the user level or role of a comments author.
    I have the authors id $comment->user_id but I can’t find any functions that will let me pass that id in and get what I want back.

    I am essentially looking for something like this:
    if ( current_user_can('level_1')) { do something }
    But for comment authors instead of the current user.

    Thanks.

Viewing 1 replies (of 1 total)
  • In case you still need this I just worked out how to do it….

    <?php $user_info = get_userdata($comment->user_id);
    
    					if ( $user_info->user_level == 10 ) {
    							echo('User level: ' . $user_info->user_level . "\n");
    					} ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Accessing Comment Author Role or Level’ is closed to new replies.