$subvalue ) { $value[ $key ] = sanitize_text_field( $subvalue ); } return $value; } return sanitize_text_field( $value ); } function adventure_travel_sanitize_date( $input ){ $date = new DateTime( $input ); return $date->format('Y-m-d'); } function adventure_travel_sanitize_number_absint( $number, $setting ) { // Ensure $number is an absolute integer (whole number, zero or greater). $number = absint( $number ); // If the input is an absolute integer, return it; otherwise, return the default return ( $number ? $number : $setting->default ); } function adventure_travel_sanitize_radio( $input, $setting ) { // Ensure input is a slug. $input = sanitize_key( $input ); // Get list of choices from the control associated with the setting. $choices = $setting->manager->get_control( $setting->id )->choices; // If the input is a valid key, return it; otherwise, return the default. return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); } function adventure_travel_sanitize_iframe( $iframe ){ $allow_tag = array( 'iframe'=>array( 'src'=>array(), 'width'=>array(), 'height'=>array() ) ); return wp_kses( $iframe, $allow_tag ); }