wp_slash_strings_only

函数


wp_slash_strings_only ( $value )
参数
  • (mixed)
    $value
    Scalar or array of scalars.
    Required:
返回值
  • (mixed) Slashes $value
相关
  • wp_slash()
定义位置
  • wp-includes/deprecated.php
    , line 4108
引入
5.3.0
弃用
5.6.0

Adds slashes to only string values in an array of values.

This should be used when preparing data for core APIs that expect slashed data.
This should not be used to escape data going directly into an SQL query.

function wp_slash_strings_only( $value ) {
	return map_deep( $value, 'addslashes_strings_only' );
}