How to add a new user meta field for all users in wordpress

  • 0

$users = get_users();
foreach( $users as $user ) {
$uid=$user->ID;
add_user_meta($uid, ‘newfield’,’0′);
}
}

$users = get_users(); foreach( $users as $user ) { $uid=$user->ID; add_user_meta($uid, ‘newfield’,’0′); } }

$users = get_users(); foreach( $users as $user ) { $uid=$user->ID; add_user_meta($uid, ‘newfield’,’0′); } }