: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @copyright Copyright (c) 2023, Code Atlantic LLC
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
* Class PUM_Utils_Sanitize
class PUM_Utils_Sanitize {
public static function text( $value = '', $args = [] ) {
return sanitize_text_field( $value );
* @param mixed|int $value
public static function checkbox( $value = null, $args = [] ) {
if ( intval( $value ) === 1 ) {
public static function measure( $value = '', $args = [], $fields = [], $values = [] ) {
if ( isset( $values[ $args['id'] . '_unit' ] ) ) {
$value .= $values[ $args['id'] . '_unit' ];
return sanitize_text_field( $value );