jetpack_sanitize_header_text_classes

Sanitize the string of classes used for header text.

Description

(string) jetpack_sanitize_header_text_classes( $classes ); 

Limit to A-Z,a-z,0-9,(space),(comma),_,-

Returns (string)

Sanitized string of CSS classes.

Parameters (1)

0. $classes
The classes.

Usage

  1. if ( !function_exists( 'jetpack_sanitize_header_text_classes' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/theme-tools/site-logo/inc/functions.php'; 
  3.  
  4. // The classes. 
  5. $classes = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = jetpack_sanitize_header_text_classes($classes); 
  9.  

Defined (1)

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

/modules/theme-tools/site-logo/inc/functions.php  
  1. function jetpack_sanitize_header_text_classes( $classes ) { 
  2. $classes = preg_replace( '/[^A-Za-z0-9\, \ ._-]/', '', $classes ); 
  3.  
  4. return $classes;