Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('gform_pre_render_6', 'populate_customers');
- function populate_customers($form){
- foreach($form['fields'] as &$field){
- if($field['type'] != 'select' || strpos($field['cssClass'], 'populate-customers') === false)
- continue;
- $blogusers = get_users('');
- $choices = array(array('text' => 'Search for a Team Member', 'value' => ' '));
- foreach($blogusers as $user) {
- $choices[] = array('text' => $user->user_email, 'value' => $user->user_email);
- }
- $field['choices'] = $choices;
- }
- return $form;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement