sanitize_html_class [ WordPress Function ]
sanitize_html_class ( $class, $fallback = '' )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: sanitize_meta, sanitize_term, sanitize_term_field, sanitize_email, sanitize_title
Santizes a html classname to ensure it only contains valid characters
Strips the string down to A-Z,a-z,0-9,_,-. If this results in an empty string then it will return the alternative value supplied.
Source
<?php
function sanitize_html_class( $class, $fallback = '' ) {
//Strip out any % encoded octets
$sanitized = preg_replace( '|%[a-fA-F0-9][a-fA-F0-9]|', '', $class );
//Limit to A-Z,a-z,0-9,_,-
$sanitized = preg_replace( '/[^A-Za-z0-9_-]/', '', $sanitized );
if ( '' == $sanitized )
$sanitized = $fallback;
return apply_filters( 'sanitize_html_class', $sanitized, $class, $fallback );
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- sanitize_html_class (WordPress Function) - WPSeek.com
WordPress lookup for sanitize_html_class, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - sanitize_html_class Wordpress hook details -- Adam Brown, BYU ...
Detailed information about every action hook and filter used in WordPress. Makes Plugin API easier to use. Lists appearance, file location, and deprecation data ...
adambrown.info - sanitize_html_class - Function Reference - PHP Cross Reference ...
Jun 1, 2011 ... Function and Method Cross Reference. sanitize_html_class(). Defined at: /wp- includes/formatting.php -> line 865. Referenced 18 times: ...
xref.yoast.com - Docs for page formatting.php
sanitize_html_class (line 1036). Santizes a html classname to ensure it only contains valid characters. Strips the string down to A-Z,a-z,0-9,_,-. If this results in an ...
phpdoc.wordpress.org