addslashes_strings_only

The timeline below displays how wordpress function addslashes_strings_only has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.6

/**
 * Adds slashes only if the provided value is a string.
 *
 * @since 5.3.0
 * @deprecated 5.6.0
 *
 * @see wp_slash()
 *
 * @param mixed $value
 * @return mixed
 */
function addslashes_strings_only($value)
{
    return is_string($value) ? addslashes($value) : $value;
}

WordPress Version: 5.3

/**
 * Adds slashes only if the provided value is a string.
 *
 * @since 5.3.0
 *
 * @param mixed $value
 * @return mixed
 */
function addslashes_strings_only($value)
{
    return is_string($value) ? addslashes($value) : $value;
}