id; $choices = hoot_customizer_get_choices( $setting ); if ( ! array_key_exists( $value, $choices ) ) $value = hoot_customizer_get_default( $setting ); return $value; } /** * Sanitize the url of uploaded media. * * @since 2.0.0 * @param string $value The url to sanitize * @return string $output The sanitized url. */ function hoot_customizer_sanitize_file_url( $value ) { $output = ''; $filetype = wp_check_filetype( $value ); if ( $filetype["ext"] ) { $output = esc_url_raw( $value ); } return $output; } /** * Sanitizes a range value * * @since 2.0.0 * @param string $color * @return string|null */ function hoot_customizer_sanitize_range( $value ) { if ( is_numeric( $value ) ) { return $value; } return 0; }