__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace CarouselSlider\Supports;
defined( 'ABSPATH' ) || exit;
/**
* Validate class
*/
class Validate {
/**
* Check if url is valid as per RFC 2396 Generic Syntax
*
* @param mixed $url The URL string.
*
* @return bool
*/
public static function url( $url ): bool {
return (bool) filter_var( $url, FILTER_VALIDATE_URL );
}
/**
* If a field has been 'checked' or not, meaning it contains
* one of the following values: 'yes', 'on', '1', 1, true, or 'true'.
* This can be used for determining if an HTML checkbox has been checked.
*
* @param mixed $value The value to be checked.
*
* @return boolean
*/
public static function checked( $value ): bool {
return in_array( $value, [ 'yes', 'on', '1', 1, true, 'true' ], true );
}
/**
* Check if value is json
*
* @param mixed $value The value to be checked.
*
* @return bool
*/
public static function json( $value ): bool {
if ( ! is_string( $value ) ) {
return false;
}
json_decode( $value );
return ( json_last_error() === JSON_ERROR_NONE );
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| FormFields | Folder | 0775 |
|
|
| SettingApi | Folder | 0775 |
|
|
| MetaBoxForm.php | File | 6.86 KB | 0775 |
|
| Sanitize.php | File | 6.45 KB | 0775 |
|
| Validate.php | File | 1.04 KB | 0775 |
|