of_sanitize_multicheck

Sanitization for multicheck.

Description

(array) of_sanitize_multicheck( (array) $input, $option ); 

Returns (array)

of sanitized values ('1' or false)

Parameters (2)

0. $input (array)
Of checkbox values
1. $option
The option.

Usage

  1. if ( !function_exists( 'of_sanitize_multicheck' ) ) { 
  2. require_once '/inc/includes/class-options-sanitize.php'; 
  3.  
  4. // of checkbox values 
  5. $input = array(); 
  6.  
  7. // The option. 
  8. $option = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = of_sanitize_multicheck($input, $option); 
  12.  

Defined (1)

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

/inc/includes/class-options-sanitize.php  
  1. function of_sanitize_multicheck( $input, $option ) { 
  2. $output = ''; 
  3. if ( is_array( $input ) ) { 
  4. foreach( $option['options'] as $key => $value ) { 
  5. $output[$key] = false; 
  6. foreach( $input as $key => $value ) { 
  7. if ( array_key_exists( $key, $option['options'] ) && $value ) { 
  8. $output[$key] = '1'; 
  9. return $output;