• Resolved throm17

    (@throm17)


    Hi

    I search to forbiden access to all of user that not admin.

    I’ve create a profil page with the personal information of user, but i want that this information be visible to admin and invisible for other.

    <php
    $user_id = um_user(‘ID’);
    um_fetch_user( $user_id );
    $meta_value = um_user(‘first_name’);
    echo $meta_value;
    echo ‘<td>’.'<br>’;
    ?>

    So, how can i do for display “first_name” only at admins ?

    Regards,

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Towhid

    (@cryptex_vinci)

    Hi @throm17

    You can try this to check if the user is admin:

    <?php 
    
    $user = wp_get_current_user();
    
    if ( $user->roles[0] == 'administrator' ) {
    	echo "this is the admin";
    }
    
    ?>

    Thanks

    Thread Starter throm17

    (@throm17)

    Thank you very much !!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘admin privilege’ is closed to new replies.