• Hi
    `$user = wp_get_current_user();
    $role = ( array ) $user->roles;

    if($role[0] == ‘administrator’ ) {
    $x = ‘true’;
    } else {
    $x = ‘false’;
    }
    $fields = array();
    $fields[] = new PMProRH_Field(
    ‘custom_date’, // input name, will also be used as meta key
    ‘text’, // type of field
    array(
    ‘label’ => ‘Delivery Date’,// custom field label
    ‘size’ => 30,// input size
    ‘profile’ => $x,// show in user profile only for admin not for all other
    ‘required’ => true, // make this field required
    ‘class’ => ‘form-control’,
    )
    ); `

    ‘profile’ => $x, -> This is not working ?, this field still showing

    we are getting $x = true and false as per role but its not working and always showing this custom field in all roles.
    what i have done wrong ?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Argument issues’ is closed to new replies.