of_sanitize_background

Sanitization for background option.

Description

of_sanitize_background( $input ); 

Parameters (1)

0. $input
The input.

Usage

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

Defined (1)

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

/inc/includes/class-options-sanitize.php  
  1. function of_sanitize_background( $input ) { 
  2.  
  3. $output = wp_parse_args( $input, array( 
  4. 'color' => '',  
  5. 'image' => '',  
  6. 'repeat' => 'repeat',  
  7. 'position' => 'top center',  
  8. 'attachment' => 'scroll' 
  9. ) ); 
  10.  
  11. $output['color'] = apply_filters( 'of_sanitize_hex', $input['color'] ); 
  12. $output['image'] = apply_filters( 'of_sanitize_upload', $input['image'] ); 
  13. $output['repeat'] = apply_filters( 'of_background_repeat', $input['repeat'] ); 
  14. $output['position'] = apply_filters( 'of_background_position', $input['position'] ); 
  15. $output['attachment'] = apply_filters( 'of_background_attachment', $input['attachment'] ); 
  16.  
  17. return $output;