A WordPress-centric search engine for devs and theme authors



wp_slash_strings_only ›

Since5.3.0
Deprecatedn/a
wp_slash_strings_only ( $value )
Parameters:
  • (mixed) $value Scalar or array of scalars.
    Required: Yes
Returns:
  • (mixed) Slashes $value
Defined at:
Codex:

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.



Source

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