Add a function: `wp_spaces_regexp()`. It is not used yet.

This function is required by a bunch of patches by miqrogroove. Needs filter docs.

Props miqrogroove.
See #27588.

Built from https://develop.svn.wordpress.org/trunk@28708


git-svn-id: http://core.svn.wordpress.org/trunk@28524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-06-09 19:30:14 +00:00
parent b964ac0148
commit 46f82b03e7
1 changed files with 21 additions and 0 deletions

View File

@ -3844,3 +3844,24 @@ function get_url_in_content( $content ) {
return false;
}
/**
* Returns the regexp for common whitespace characters.
*
* By default, spaces include new lines, tabs, nbsp entities, and the UTF-8 nbsp.
* This is designed to replace the PCRE \s sequence. In ticket #22692, that
* sequence was found to be unreliable due to random inclusion of the A0 byte.
*
* @since 4.0.0
*
* @return string The spaces regexp.
*/
function wp_spaces_regexp() {
static $spaces;
if ( empty( $spaces ) ) {
$spaces = apply_filters( 'wp_spaces_regexp', '[\r\n\t ]|\xC2\xA0| ' );
}
return $spaces;
}