advantage_theme_options_validate

The Advantage advantage theme options validate function.

Description

advantage_theme_options_validate( $input ); 

Parameters (1)

0. $input
The input.

Usage

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

Defined (1)

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

/inc/theme-options.php  
  1. function advantage_theme_options_validate( $input ) { 
  2. $theme_options = advantage_theme_options_array(); 
  3. foreach ( $theme_options as $theme_option ) { 
  4. switch ( $theme_option['type'] ) { 
  5. case 'checkbox': 
  6. if ( ! isset( $input[ $theme_option['name'] ] ) ) 
  7. $input[$theme_option['name']] = null; 
  8. $input[ $theme_option['name'] ] = ( $input[ $theme_option['name'] ] == 1 ? 1 : 0 ); 
  9. break; 
  10. case 'text': 
  11. case 'textarea': 
  12. $input[ $theme_option['name'] ] = wp_kses_stripslashes( $input[ $theme_option['name'] ] ); 
  13. break; 
  14. case 'number':  
  15. $input[ $theme_option['name'] ] = intval( $input[ $theme_option['name'] ] );  
  16. break;  
  17. case 'url':  
  18. $input[ $theme_option['name'] ] = esc_url_raw( $input[$theme_option['name'] ] );  
  19. break; 
  20. case 'color': 
  21. $input[ $theme_option['name'] ] = sanitize_text_field( $input[ $theme_option['name'] ] );  
  22. break; 
  23. if ( $input['respbp'] < 960 ) 
  24. $input['respbp'] = 960; 
  25. $input['advantage_scheme_css'] = advantage_scheme_css( $input ); 
  26. //Update Scheme Options 
  27. $options = advantage_get_options(); 
  28. if ( $input['colorscheme'] != $options['colorscheme'] ) { 
  29. $scheme = $theme_options['colorscheme']['values'][ $input['colorscheme'] ]; 
  30. $input['schemecss'] = $scheme['css'];  
  31. foreach ( $scheme['options'] as $scheme_options ) 
  32. $input[ $scheme_options['name'] ] = $scheme_options['value']; 
  33. return $input;