WordPress at a glance
function is not described

wp_slash_strings_only() WP 5.3.0

Deprecated from version 5.6.0. It is no longer supported and can be removed in future releases. Use wp_slash() instead.

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.

No Hooks.

Return

Mixed. Slashes $value

Usage

wp_slash_strings_only( $value );
$value(mixed) (required)
Scalar or array of scalars.

Notes

  • See: wp_slash()

Changelog

Since 5.3.0 Introduced.
Deprecated Since 5.6.0 Use wp_slash()

Code of wp_slash_strings_only() WP 5.7

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