Warning: This function has been deprecated. Use wp_slash() instead.

wp_slash_strings_only() WordPress Function

The wp_slash_strings_only() function is used to add slashes to a string. This is useful when you need to store data in a database that needs to be escaped.

wp_slash_strings_only( mixed $value ) #

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


Description

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.

Top ↑

See also


Top ↑

Parameters

$value

(mixed)(Required)Scalar or array of scalars.


Top ↑

Return

(mixed) Slashes $value


Top ↑

Source

File: wp-includes/deprecated.php

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


Top ↑

Changelog

Changelog
VersionDescription
5.6.0Use wp_slash()
5.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More