of_sanitize_typography
Sanitization for typography option.
Description
Parameters (2)
- 0. $input
- The input.
- 1. $option
- The option.
Usage
if ( !function_exists( 'of_sanitize_typography' ) ) { require_once '/inc/includes/class-options-sanitize.php'; } // The input. $input = null; // The option. $option = null; // NOTICE! Understand what this does before running. $result = of_sanitize_typography($input, $option);
Defined (1)
The function is defined in the following location(s).
- /inc/includes/class-options-sanitize.php
- function of_sanitize_typography( $input, $option ) {
- $output = wp_parse_args( $input, array(
- 'size' => '',
- 'face' => '',
- 'style' => '',
- 'color' => ''
- ) );
- if ( isset( $option['options']['faces'] ) && isset( $input['face'] ) ) {
- if ( !( array_key_exists( $input['face'], $option['options']['faces'] ) ) ) {
- $output['face'] = '';
- }
- }
- else {
- $output['face'] = apply_filters( 'of_font_face', $output['face'] );
- }
- $output['size'] = apply_filters( 'of_font_size', $output['size'] );
- $output['style'] = apply_filters( 'of_font_style', $output['style'] );
- $output['color'] = apply_filters( 'of_sanitize_color', $output['color'] );
- return $output;
- }