Docs: Correct description for `wp_slash()` and `wp_unslash()`.

The array received or returned by these functions is not always an array of strings, for example when slashing or unslashing an array of arrays.

Follow-up to [47400], [48441], [49926].

Props johnbillion.
See #51800.
Built from https://develop.svn.wordpress.org/trunk@49968


git-svn-id: http://core.svn.wordpress.org/trunk@49669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-01-17 16:38:06 +00:00
parent 87b092dc30
commit ed240e087e
2 changed files with 7 additions and 7 deletions

View File

@ -5515,7 +5515,7 @@ function sanitize_trackback_urls( $to_ping ) {
} }
/** /**
* Add slashes to a string or array of strings, in a recursive manner. * Adds slashes to a string or recursively adds slashes to strings within an array.
* *
* This should be used when preparing data for core API that expects slashed data. * This should be used when preparing data for core API that expects slashed data.
* This should not be used to escape data going directly into an SQL query. * This should not be used to escape data going directly into an SQL query.
@ -5523,8 +5523,8 @@ function sanitize_trackback_urls( $to_ping ) {
* @since 3.6.0 * @since 3.6.0
* @since 5.5.0 Non-string values are left untouched. * @since 5.5.0 Non-string values are left untouched.
* *
* @param string|string[] $value String or array of strings to slash. * @param string|array $value String or array of data to slash.
* @return string|string[] Slashed $value. * @return string|array Slashed $value.
*/ */
function wp_slash( $value ) { function wp_slash( $value ) {
if ( is_array( $value ) ) { if ( is_array( $value ) ) {
@ -5539,15 +5539,15 @@ function wp_slash( $value ) {
} }
/** /**
* Remove slashes from a string or array of strings. * Removes slashes from a string or recursively removes slashes from strings within an array.
* *
* This should be used to remove slashes from data passed to core API that * This should be used to remove slashes from data passed to core API that
* expects data to be unslashed. * expects data to be unslashed.
* *
* @since 3.6.0 * @since 3.6.0
* *
* @param string|array $value String or array of strings to unslash. * @param string|array $value String or array of data to unslash.
* @return string|array Unslashed $value * @return string|array Unslashed $value.
*/ */
function wp_unslash( $value ) { function wp_unslash( $value ) {
return stripslashes_deep( $value ); return stripslashes_deep( $value );

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.7-alpha-49967'; $wp_version = '5.7-alpha-49968';
/** /**
* 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.