$fam ) { $font_names[] = $fam['name']; } // Get all non-Google font names $not_google = array( 'inherit', 'Arial, Helvetica, sans-serif', 'Century Gothic', 'Comic Sans MS', 'Courier New', 'Georgia, Times New Roman, Times, serif', 'Helvetica', 'Impact', 'Lucida Console', 'Lucida Sans Unicode', 'Palatino Linotype', 'Tahoma, Geneva, sans-serif', 'Trebuchet MS, Helvetica, sans-serif', 'Verdana, Geneva, sans-serif' ); // Merge them both into one array $valid = array_merge( $font_names, $not_google ); // Sanitize if ( in_array( $input, $valid ) ) { return $input; } else { return 'Open Sans'; } } /** * Sanitize font weight * @since 1.0.0 */ function brand_sanitize_font_weight( $input ) { $valid = array( 'normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900' ); if ( in_array( $input, $valid ) ) { return $input; } else { return 'normal'; } } /** * Sanitize text transform * @since 1.0.0 */ function brand_sanitize_text_transform( $input ) { $valid = array( 'none', 'capitalize', 'uppercase', 'lowercase' ); if ( in_array( $input, $valid ) ) { return $input; } else { return 'none'; } } function brand_sanitize_bg_repeat($data) { if(in_array($data, array('repeat', 'no-repeat', 'repeat-x', 'repeat-y') ) === true) { return $data; } else{ return 'no-repeat'; } } function brand_sanitize_bg_attachment($data) { if(in_array($data, array('scroll', 'fixed', 'local') ) === true) { return $data; } else{ return 'fixed'; } } function brand_sanitize_bg_size($data) { if(in_array($data, array('auto', '100%', 'cover', 'contain') ) === true) { return $data; } else{ return 'cover'; } } function brand_sanitize_nav_orientation($data) { if(in_array( $data, array( 'horizontal', 'vertical' ) ) === true ) { return $data; } else{ return 'horizontal'; } } function units_sanitization($data) { $pattern = '/^\s*[0-9]+(\.[0-9])?(?:px|%)\s*$/'; if ( preg_match( $pattern, $data ) === 1 ) { return $data; } return '0'; } function height_units_sanitization($data) { $pattern = '/^\s*[0-9]+(\.[0-9])?(?:px|%|vh)\s*$/'; if ( preg_match( $pattern, $data ) === 1 ) { return $data; } return 'auto'; } function brand_sanitize_posts_listing_styles($data) { if( in_array( $data, array( 'masonry', 'classic' ) ) === true ) { return $data; } else{ return 'classic'; } } function brand_sanitize_col_numb( $data ) { if( $data >= 1 && $data <= 6 ) { return $data; } else{ return 1; } } function brand_sanitize_boolopt( $data ) { if( in_array($data, array('yes','no')) === true ) { return $data; } else{ return 'no'; } } function brand_sanitize_header_type( $data ) { if( in_array( $data, array( 'slider','image', 'no-header' ) ) === true ) { return $data; } else{ return 'image'; } }