• Resolved itvizkids

    (@itvizkids)


    I am building a Job Portal. In which, I have kept a Phone Number Entry field. I want the field to be only visible to admin users and hide that field from others. I am not using any plugins. It’s a custom designed. Any WordPress hook/code can help me?
    Is that thing possible?
    What code/hooks I need to use?

    Please help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Here some codes for admin users

    <?php if(is_super_admin( ))
    {
    //Phone Number Entry field
    }
     ?>

    or

    <?php if(is_admin())
    {
    //Phone Number Entry field
    }
     ?>

    or

    <?php if( current_user_can('editor') || current_user_can('administrator') ) {  ?>
      //Phone Number Entry field
    <?php } ?>

    or

    <?php
    global $current_user;
    get_currentuserinfo();
    $user_id = $current_user->ID
    //usually admin user id is 1 if its not working check admin user id from wp_users table
    if($user_id == 1) {
       //Phone Number Entry field
    }
    ?>

    Thread Starter itvizkids

    (@itvizkids)

    Thanks a lot @venugopal!
    Awesome! This Worked out for me!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘I want to show a custom entry field only to admin users!’ is closed to new replies.