Skip to content

Commit

Permalink
Add stub for wp_slash
Browse files Browse the repository at this point in the history
See #125
  • Loading branch information
gmazzap committed Dec 12, 2022
1 parent 6dfeacc commit 2f2cddc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions inc/wp-helper-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,12 @@ function wp_validate_boolean($var)
}
}

if ( ! function_exists('wp_slash')) {
function wp_slash($value)
{
if (is_array($value)) {
return array_map('wp_slash', $value);
}
return is_string($value) ? addslashes($value) : $value;
}
}

0 comments on commit 2f2cddc

Please sign in to comment.