of_sanitize_typography

Sanitization for typography option.

Description

of_sanitize_typography( $input, $option ); 

Parameters (2)

0. $input
The input.
1. $option
The option.

Usage

  1. if ( !function_exists( 'of_sanitize_typography' ) ) { 
  2. require_once '/admin/includes/class-options-sanitization.php'; 
  3.  
  4. // The input. 
  5. $input = null; 
  6.  
  7. // The option. 
  8. $option = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = of_sanitize_typography($input, $option); 
  12.  

Defined (1)

The function is defined in the following location(s).

/admin/includes/class-options-sanitization.php  
  1. function of_sanitize_typography( $input, $option ) { 
  2.  
  3. $output = wp_parse_args( $input, array( 
  4. 'size' => '',  
  5. 'face' => '',  
  6. 'style' => '',  
  7. 'color' => '' 
  8. ) ); 
  9.  
  10. if ( isset( $option['options']['faces'] ) && isset( $input['face'] ) ) { 
  11. if ( !( array_key_exists( $input['face'], $option['options']['faces'] ) ) ) { 
  12. $output['face'] = ''; 
  13. else { 
  14. $output['face'] = apply_filters( 'of_font_face', $output['face'] ); 
  15.  
  16. $output['size'] = apply_filters( 'of_font_size', $output['size'] ); 
  17. $output['style'] = apply_filters( 'of_font_style', $output['style'] ); 
  18. $output['color'] = apply_filters( 'of_sanitize_color', $output['color'] ); 
  19. return $output;