public
|
#
__construct( CMB2_Field $field, mixed $value )
Setup our class vars
Parameters
- $field
- A CMB2 field object.
- $value
- Field value.
Since
1.1.0
|
public
mixed
|
#
__call( string $name, array $arguments )
Catchall method if field's 'sanitization_cb' is NOT defined,
or field type does not have a corresponding validation method.
Catchall method if field's 'sanitization_cb' is NOT defined,
or field type does not have a corresponding validation method.
Parameters
- $name
- Non-existent method name.
- $arguments
- All arguments passed to the method.
Returns
mixed
Since
1.0.0
|
public
|
#
default_sanitization( )
Default fallback sanitization method. Applies filters.
Default fallback sanitization method. Applies filters.
Since
1.0.2
|
protected
mixed
|
#
_default_sanitization( )
Default sanitization method, sanitize_text_field. Checks if value is array.
Default sanitization method, sanitize_text_field. Checks if value is array.
Returns
mixed Sanitized value.
Since
2.2.4
|
public
mixed
|
#
taxonomy( )
Sets the object terms to the object (if not options-page) and optionally returns the sanitized term values.
Sets the object terms to the object (if not options-page) and optionally returns the sanitized term values.
Returns
mixed Blank value, or sanitized term values if "cmb2_return_taxonomy_values_{$cmb_id}" is true.
Since
2.2.4
|
public
string|false
|
#
checkbox( )
Simple checkbox validation
Simple checkbox validation
Returns
string|false 'on' or false
Since
1.0.1
|
public
string
|
#
text_url( )
Validate url in a meta value.
Validate url in a meta value.
Returns
string Empty string or escaped url
Since
1.0.1
|
public
|
|
public
string
|
#
text_email( )
Validate email in a meta value
Validate email in a meta value
Returns
string Empty string or sanitized email
Since
1.0.1
|
public
string
|
#
text_money( )
Validate money in a meta value
Validate money in a meta value
Returns
string Empty string or sanitized money value
Since
1.0.1
|
public
string
|
#
text_date_timestamp( )
Converts text date to timestamp
Converts text date to timestamp
Returns
string Timestring
Since
1.0.2
|
public
string|array
|
#
text_datetime_timestamp( boolean $repeat = false )
Datetime to timestamp
Parameters
- $repeat
- Whether or not to repeat.
Returns
string|array Timestring
Since
1.0.1
|
public
string
|
#
text_datetime_timestamp_timezone( boolean $repeat = false )
Datetime to timestamp with timezone
Datetime to timestamp with timezone
Parameters
- $repeat
- Whether or not to repeat.
Returns
string Timestring
Since
1.0.1
|
public
string
|
#
textarea( )
Sanitize textareas and wysiwyg fields
Sanitize textareas and wysiwyg fields
Returns
string Sanitized data
Since
1.0.1
|
public
string
|
#
textarea_code( boolean $repeat = false )
Sanitize code textareas
Parameters
- $repeat
- Whether or not to repeat.
Returns
string Sanitized data
Since
1.0.2
|
public
string
|
#
file( )
Handles saving of attachment post ID and sanitizing file url
Handles saving of attachment post ID and sanitizing file url
Returns
string Sanitized url
Since
1.1.0
|
public
array
|
#
_get_group_file_value_array( mixed $id_key )
Gets the values for the file field type from the data being saved.
Gets the values for the file field type from the data being saved.
Parameters
Returns
array
Since
2.2.0
|
public
mixed
|
#
_save_file_id_value( mixed $file_id_key )
Peforms saving of file attachement's ID
Peforms saving of file attachement's ID
Parameters
- $file_id_key
- ID key to use.
Returns
mixed
Since
1.1.0
|
public
mixed
|
#
_save_utc_value( mixed $utc_key, mixed $utc_stamp )
Peforms saving of text_datetime_timestamp_timezone utc timestamp
Peforms saving of text_datetime_timestamp_timezone utc timestamp
Parameters
- $utc_key
- UTC key.
- $utc_stamp
- UTC timestamp.
Returns
mixed
Since
2.2.0
|
public
CMB2_Field
|
#
_new_supporting_field( mixed $new_field_id )
Returns a new, supporting, CMB2_Field object based on a new field id.
Returns a new, supporting, CMB2_Field object based on a new field id.
Parameters
- $new_field_id
- New field ID.
Returns
Since
2.2.0
|
public
mixed
|
#
_check_repeat( string $method, boolean $repeat )
If repeating, loop through and re-apply sanitization method
If repeating, loop through and re-apply sanitization method
Parameters
- $method
- Class method.
- $repeat
- Whether repeating or not.
Returns
mixed Sanitized value
Since
1.1.0
|
public
boolean
|
#
_is_empty_array( mixed $to_check )
Determine if passed value is an empty array
Determine if passed value is an empty array
Parameters
- $to_check
- Value to check.
Returns
boolean Whether value is an array that's empty
Since
2.0.6
|
public static
string
|
#
sanitize_and_secure_url( string $url, array $protocols = null, string $default = null )
Sanitize a URL. Make the default scheme HTTPS.
Sanitize a URL. Make the default scheme HTTPS.
Parameters
- $url
- $value Unescaped URL.
- $protocols
- Allowed protocols for URL.
- $default
- Default value if no URL found.
Returns
string escaped URL.
Since
2.10.0
|
public
boolean
|
#
is_empty_value( )
Check if the current field's value is empty.
Check if the current field's value is empty.
Returns
boolean Wether value is empty.
Since
2.9.1
|
public
boolean
|
#
is_valid_date_value( )
Check if the current field's value is a valid date value.
Check if the current field's value is a valid date value.
Returns
boolean Wether value is a valid date value.
Since
2.9.1
|