of_sanitize_multicheck
Sanitization for multicheck.
Description
Returns (array)
of sanitized values ('1' or false)
Parameters (2)
- 0. $input (array)
- Of checkbox values
- 1. $option
- The option.
Usage
if ( !function_exists( 'of_sanitize_multicheck' ) ) { require_once '/inc/includes/class-options-sanitize.php'; } // of checkbox values $input = array(); // The option. $option = null; // NOTICE! Understand what this does before running. $result = of_sanitize_multicheck($input, $option);
Defined (1)
The function is defined in the following location(s).
- /inc/includes/class-options-sanitize.php
- function of_sanitize_multicheck( $input, $option ) {
- $output = '';
- if ( is_array( $input ) ) {
- foreach( $option['options'] as $key => $value ) {
- $output[$key] = false;
- }
- foreach( $input as $key => $value ) {
- if ( array_key_exists( $key, $option['options'] ) && $value ) {
- $output[$key] = '1';
- }
- }
- }
- return $output;
- }