first commit

This commit is contained in:
2026-03-05 13:07:40 +01:00
commit 64ba0721ee
25709 changed files with 4691006 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
<?php
/**
* Sanitize Utility
*
* @package PUM
* @copyright Copyright (c) 2023, Code Atlantic LLC
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* Class PUM_Utils_Sanitize
*/
class PUM_Utils_Sanitize {
/**
* @param string $value
* @param array $args
*
* @return string
*/
public static function text( $value = '', $args = [] ) {
return sanitize_text_field( $value );
}
/**
* @param mixed|int $value
* @param array $args
*
* @return bool|int
*/
public static function checkbox( $value = null, $args = [] ) {
if ( intval( $value ) === 1 ) {
return 1;
}
return 0;
}
public static function measure( $value = '', $args = [], $fields = [], $values = [] ) {
if ( isset( $values[ $args['id'] . '_unit' ] ) ) {
$value .= $values[ $args['id'] . '_unit' ];
}
return sanitize_text_field( $value );
}
}