eewee_options_validate

The Eewee responsive design eewee options validate function.

Description

eewee_options_validate( $input ); 

Parameters (1)

0. $input
The input.

Usage

  1. if ( !function_exists( 'eewee_options_validate' ) ) { 
  2. require_once '/includes/admin/theme-admin.php'; 
  3.  
  4. // The input. 
  5. $input = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = eewee_options_validate($input); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/admin/theme-admin.php  
  1. function eewee_options_validate($input) { 
  2. $options = get_option('eewee_options'); 
  3.  
  4. if ( isset ( $input['validation-submit'] ) ) : 
  5. $tab = $input['validation-submit']; 
  6. else: 
  7. $tab = 'general'; 
  8. endif; 
  9. $validate_settings = eewee_get_settings($tab); 
  10.  
  11. foreach ($validate_settings as $setting) { 
  12.  
  13. if ($setting['type'] == 'checkbox' and !isset($input[$setting['id']]) )  
  14. $options[$setting['id']] = 'false';  
  15. }  
  16. elseif ($setting['type'] == 'multicheckbox') 
  17. foreach ( $setting['choices'] as $value => $label ) { 
  18. $checkbox = $setting['id'] . '_' . $value; 
  19. if ( !isset($input[$checkbox] ) ) : 
  20. $options[$checkbox] = 'false';  
  21. else : 
  22. $options[$checkbox] = 'true';  
  23. endif; 
  24. elseif ($setting['type'] == 'radio' and !isset($input[$setting['id']]) )  
  25. $options[$setting['id']] = 1;  
  26. elseif ($setting['type'] == 'textarea') 
  27. $options[$setting['id']] = esc_textarea(trim($input[$setting['id']])); 
  28. elseif ($setting['type'] == 'html') 
  29. $options[$setting['id']] = wp_kses_post(trim($input[$setting['id']])); 
  30. elseif ($setting['type'] == 'url') 
  31. $options[$setting['id']] = esc_url(trim($input[$setting['id']])); 
  32. else  
  33. $options[$setting['id']] = esc_attr(trim($input[$setting['id']])); 
  34. return $options;