_wp_can_use_pcre_u

Returns whether PCRE/u (PCRE_UTF8 modifier) is available for use.

Description

_wp_can_use_pcre_u( (null) $set = null ); 

Parameters (1)

0. $set — Optional. (null) => null
- Used for testing only null : default - get PCRE/u capability false : Used for testing - return false for future calls to this function reset: Used for testing - restore default behavior of this function

Usage

  1. if ( !function_exists( '_wp_can_use_pcre_u' ) ) { 
  2. require_once ABSPATH . WPINC . '/compat.php'; 
  3. $set = null; 
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = _wp_can_use_pcre_u($set); 
  7.  

Defined (1)

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

/wp-includes/compat.php  
  1. function _wp_can_use_pcre_u( $set = null ) { 
  2. static $utf8_pcre = 'reset'; 
  3.  
  4. if ( null !== $set ) { 
  5. $utf8_pcre = $set; 
  6.  
  7. if ( 'reset' === $utf8_pcre ) { 
  8. $utf8_pcre = @preg_match( '/^./u', 'a' ); 
  9.  
  10. return $utf8_pcre;