PHP Class Kirki_Sanitize_Values, kirki

显示文件 Open project: aristath/kirki Class Usage Examples

Public Methods

Method Description
__callStatic ( string $name, mixed $arguments ) : mixed Fallback for non-existing methods.
checkbox ( boolean | string $value ) : boolean Checkbox sanitization callback.
color ( string $value ) : string Sanitize colors.
css_dimension ( string $value ) : string Sanitizes css dimensions.
dropdown_pages ( integer $page_id, WP_Customize_Setting $setting ) : integer | string Drop-down Pages sanitization callback.
filter_number ( string $value ) : integer | float Filters numeric values.
number ( integer | float | double | string $value ) : integer | float | double Sanitize number options.
rgba ( string $value ) : string Sanitize RGBA colors
sortable ( string | array $value ) : string Sanitize sortable controls
unfiltered ( integer | string | array $value ) : integer | string | array DOES NOT SANITIZE ANYTHING.

Method Details

__callStatic() public static method

Fallback for non-existing methods.
public static __callStatic ( string $name, mixed $arguments ) : mixed
$name string The method we're trying to access.
$arguments mixed The arguments the method we're trying to call accepts.
return mixed The $arguments provided.

checkbox() public static method

Sanitization callback for 'checkbox' type controls. This callback sanitizes $value as a boolean value, either TRUE or FALSE. Deprecated. Use Kirki_Field_Checkbox::sanitize() instead.
See also: Kirki_Field_Checkbox::sanitize()
public static checkbox ( boolean | string $value ) : boolean
$value boolean | string Whether the checkbox is checked.
return boolean Whether the checkbox is checked.

color() public static method

Sanitize colors.
Since: 0.8.5
public static color ( string $value ) : string
$value string The value to be sanitized.
return string

css_dimension() public static method

Sanitizes css dimensions.
Since: 2.2.0
public static css_dimension ( string $value ) : string
$value string The value to be sanitized.
return string

dropdown_pages() public static method

- Sanitization: dropdown-pages - Control: dropdown-pages Sanitization callback for 'dropdown-pages' type controls. This callback sanitizes $page_id as an absolute integer, and then validates that $input is the ID of a published page.
See also: absint() https://developer.wordpress.org/reference/functions/absint/
See also: get_post_status() https://developer.wordpress.org/reference/functions/get_post_status/
public static dropdown_pages ( integer $page_id, WP_Customize_Setting $setting ) : integer | string
$page_id integer Page ID.
$setting WP_Customize_Setting Setting instance.
return integer | string Page ID if the page is published; otherwise, the setting default.

filter_number() public static method

Filters numeric values.
public static filter_number ( string $value ) : integer | float
$value string The value to be sanitized.
return integer | float

number() public static method

Sanitize number options.
Since: 0.5
public static number ( integer | float | double | string $value ) : integer | float | double
$value integer | float | double | string The value to be sanitized.
return integer | float | double

rgba() public static method

Sanitize RGBA colors
Since: 0.8.5
public static rgba ( string $value ) : string
$value string The value to be sanitized.
return string

sortable() public static method

Sanitize sortable controls
Since: 0.8.3
public static sortable ( string | array $value ) : string
$value string | array The value to be sanitized.
return string

unfiltered() public static method

DOES NOT SANITIZE ANYTHING.
Since: 0.5
public static unfiltered ( integer | string | array $value ) : integer | string | array
$value integer | string | array The value to be sanitized.
return integer | string | array