: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Implementation for WordPress functions missing in older WordPress versions.
if ( ! function_exists( 'wp_slash_strings_only' ) ) {
* Adds slashes to only string values in an array of values.
* Compat for WordPress < 5.3.0.
* @param mixed $value Scalar or array of scalars.
* @return mixed Slashes $value
function wp_slash_strings_only( $value ) {
return map_deep( $value, 'addslashes_strings_only' );
if ( ! function_exists( 'addslashes_strings_only' ) ) {
* Adds slashes only if the provided value is a string.
* Compat for WordPress < 5.3.0.
function addslashes_strings_only( $value ) {
return is_string( $value ) ? addslashes( $value ) : $value;