• I want to show a link based on if the logged in user has permission to view the post, and if they don’t have permission to either show different text or nothing at all.

    I was able to do this before the update by grabbing the user’s role and then comparing it to the _um_access_roles for the post.

    However now $ultimatemember->user->get_role(); is not working(it breaks the website). What I can get to work is `if( is_user_logged_in() ) {
    $user = wp_get_current_user();
    $current_role = ( array ) $user->roles;`
    but now the role titles don’t match up. i.e. um_admin vs admin.

  • The topic ‘See if current user has permission to view post for link’ is closed to new replies.