: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
private function sanitize_value( $value ) {
// Some browsers allow other non-digit/decimal characters to be submitted
// with the num input, which then trips the is_numeric validation below.
// To get around this we remove all chars that are not expected.
$signed_value = preg_replace( '/[^-0-9.]/', '', $value );
// If there's no number on the signed value we return zero.
// We have to do that because since PHP 8.0, the abs() function is allowed an argument with int|float type.
if ( ! is_numeric( $signed_value ) ) {
$abs_value = abs( $signed_value );
$value = strpos( $signed_value, '-' ) === 0 ? '-' . $abs_value : $abs_value;
new WPForms_Field_Number_Slider();