Advertisement
cjcombrink

Untitled

Mar 20th, 2014
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. add_filter('gform_pre_render_6', 'populate_customers');
  2. function populate_customers($form){
  3.  
  4.  
  5. foreach($form['fields'] as &$field){
  6.  
  7. if($field['type'] != 'select' || strpos($field['cssClass'], 'populate-customers') === false)
  8. continue;
  9.  
  10. $blogusers = get_users('');
  11.  
  12. $choices = array(array('text' => 'Search for a Team Member', 'value' => ' '));
  13.  
  14. foreach($blogusers as $user) {
  15. $choices[] = array('text' => $user->user_email, 'value' => $user->user_email);
  16. }
  17.  
  18. $field['choices'] = $choices;
  19.  
  20. }
  21.  
  22. return $form;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement