Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: dcf3c0d8be
Fetching contributors…

Cannot retrieve contributors at this time

45 lines (34 sloc) 0.788 kB
<?php
/**
* @package KC_Essentials
*/
/**
* Remove unwanted characters from custom classes
*
* @param string $input Classes string to process
* @return string Sanitized html classes
*/
function kc_essentials_sanitize_html_classes( $input ) {
if ( !is_array($input) ) {
if ( strpos($input, ' ') )
$input = explode( ' ', $input );
else
$input = array( $input );
}
$output = array();
foreach ( $input as $c )
$output[] = sanitize_html_class( $c );
return join( ' ', $output );
}
function kc_essentials_sanitize_numbers( $value, $glue = ',' ) {
$_sizes = explode( $glue, $value );
foreach ( $_sizes as $idx => $_s ) {
$_w = absint( $_s );
if ( !$_w )
unset( $_sizes[$idx] );
else
$_sizes[$idx] = $_w;
}
return implode( $glue, $_sizes );
}
?>
Jump to Line
Something went wrong with that request. Please try again.