mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-08 16:41:44 +01:00
Docs: Add missing DocBlocks for mb_substr()
and _mb_substr()
.
Both will be ignored from parsing as and serve as compat functions for PHP's `mb_substr()`, which is not enabled by default. Introduced in [17621]. See #32246. Built from https://develop.svn.wordpress.org/trunk@36017 git-svn-id: http://core.svn.wordpress.org/trunk@35982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
67e1f55c4b
commit
be6589730d
@ -42,15 +42,40 @@ function _wp_can_use_pcre_u( $set = null ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( ! function_exists( 'mb_substr' ) ) :
|
if ( ! function_exists( 'mb_substr' ) ) :
|
||||||
|
/**
|
||||||
|
* Compat function to mimic mb_substr().
|
||||||
|
*
|
||||||
|
* @ignore
|
||||||
|
* @since 3.2.0
|
||||||
|
*
|
||||||
|
* @param string $str The string to extract the substring from.
|
||||||
|
* @param int $start Position to being extraction from in `$str`.
|
||||||
|
* @param int|null $length Optional. Maximum number of characters to extract from `$str`.
|
||||||
|
* Default null.
|
||||||
|
* @param string|null $encoding Optional. Character encoding to use. Default null.
|
||||||
|
* @return string Extracted substring.
|
||||||
|
*/
|
||||||
function mb_substr( $str, $start, $length = null, $encoding = null ) {
|
function mb_substr( $str, $start, $length = null, $encoding = null ) {
|
||||||
return _mb_substr( $str, $start, $length, $encoding );
|
return _mb_substr( $str, $start, $length, $encoding );
|
||||||
}
|
}
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
|
* Internal compat function to mimic mb_substr().
|
||||||
|
*
|
||||||
* Only understands UTF-8 and 8bit. All other character sets will be treated as 8bit.
|
* Only understands UTF-8 and 8bit. All other character sets will be treated as 8bit.
|
||||||
* For $encoding === UTF-8, the $str input is expected to be a valid UTF-8 byte sequence.
|
* For $encoding === UTF-8, the $str input is expected to be a valid UTF-8 byte sequence.
|
||||||
* The behavior of this function for invalid inputs is undefined.
|
* The behavior of this function for invalid inputs is undefined.
|
||||||
|
*
|
||||||
|
* @ignore
|
||||||
|
* @since 3.2.0
|
||||||
|
*
|
||||||
|
* @param string $str The string to extract the substring from.
|
||||||
|
* @param int $start Position to being extraction from in `$str`.
|
||||||
|
* @param int|null $length Optional. Maximum number of characters to extract from `$str`.
|
||||||
|
* Default null.
|
||||||
|
* @param string|null $encoding Optional. Character encoding to use. Default null.
|
||||||
|
* @return string Extracted substring.
|
||||||
*/
|
*/
|
||||||
function _mb_substr( $str, $start, $length = null, $encoding = null ) {
|
function _mb_substr( $str, $start, $length = null, $encoding = null ) {
|
||||||
if ( null === $encoding ) {
|
if ( null === $encoding ) {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.5-alpha-36016';
|
$wp_version = '4.5-alpha-36017';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user