Definition:
function wp_strip_all_tags($string, $remove_breaks = false) {}
Properly strip all HTML tags including script and style
Parameters
- string $string: String containing HTML tags
- bool $remove_breaks: optional Whether to remove left over line breaks and white space chars
Return values
returns:The processed string.
Source code
function wp_strip_all_tags($string, $remove_breaks = false) { $string = preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $string ); $string = strip_tags($string); if ( $remove_breaks ) $string = preg_replace('/[\r\n\t ]+/', ' ', $string); return trim($string); }
4147
No comments yet... Be the first to leave a reply!