Advertisement
Guest User

Untitled

a guest
Apr 25th, 2014
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. $this->settings['manageraccess'] = array(
  2. 'section' => 'manager',
  3. 'title' => __('Manager Mode Access'),
  4. 'desc' => __(''),
  5. 'type' => 'manageraccess',
  6. 'std' => '',
  7. 'dflt' => '',
  8. 'helplink'=> 'yes',
  9. 'submit' => 'yes'
  10. );
  11.  
  12. 'choices' => array(
  13. 'op1' => 'Option 1',
  14. 'op2' => 'Option 2',
  15. ),
  16.  
  17. case 'manageraccess':
  18. global $wp_roles;
  19. $all_roles = $wp_roles->roles;
  20. $editable_roles = apply_filters('editable_roles', $all_roles);
  21. echo '<select multiple="multiple" class="select chozed-select' . $field_class . '" name="myplugin_options[' . $id . '][]" data-placeholder="&nbsp;">';
  22. foreach($editable_roles as $role=>$theroles){
  23. echo '<option value="' . esc_attr($role) . '" '.selected($options[$id], $role, false) . '>'.$wp_roles->role_names[$role].'</option>';
  24. }
  25. echo '</select>' . $helplink;
  26. if ($desc != '')
  27. echo '<br /><div class="ssfa-description">' . $desc . '</div>';
  28. if ($submit != null)
  29. echo '<br /><br /><br />'.$submit;
  30. break;
  31.  
  32. public function get_settings(){
  33. global $wp_roles;
  34.  
  35. $this->settings['managertest'] = array(
  36. 'section' => 'manager',
  37. 'title' => __('Manager Mode Access'),
  38. 'desc' => __(''),
  39. 'type' => 'multi_select',
  40. 'std' => '',
  41. 'dflt' => '',
  42. 'choices' => $wp_roles->role_names,
  43. 'helplink'=> 'yes',
  44. 'submit' => 'yes'
  45. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement