Settings_Sanitize
Settings Sanitize Class.
Namespace: WebberZone\Image_Optimizer\Admin\Settings
Since: 1.0.0
Source: includes/admin/settings/class-settings-sanitize.php line 22
Methods
__construct()
Main constructor class.
Line: 47
public function __construct( $args );
| Type | Name | Description |
|---|---|---|
mixed |
$args |
{ |
get_option()
Get the value of a settings field.
Line: 66
public function get_option( $option, $default_value = ... ): mixed;
| Type | Name | Description |
|---|---|---|
string |
$option |
Settings field name. |
mixed |
$default_value |
Default value if option is not found. |
Returns: mixed
sanitize_missing()
Fallback for field types that declare no sanitize callback of their own.
Line: 82
public function sanitize_missing( $value ): mixed;
| Type | Name | Description |
|---|---|---|
mixed |
$value |
Setting Value. |
Returns: mixed — Sanitized value.
sanitize_text_field()
Sanitize text fields
Line: 110
public function sanitize_text_field( $value ): string;
| Type | Name | Description |
|---|---|---|
string |
$value |
The field value. |
Returns: string — Sanitizied value
sanitize_number_field()
Sanitize number fields
Line: 120
public function sanitize_number_field( $value ): string;
| Type | Name | Description |
|---|---|---|
string |
$value |
The field value. |
Returns: string — Sanitized value
sanitize_csv_field()
Sanitize CSV fields
Line: 130
public function sanitize_csv_field( $value ): string;
| Type | Name | Description |
|---|---|---|
string |
$value |
The field value. |
Returns: string — Sanitizied value
sanitize_numbercsv_field()
Sanitize CSV fields which hold numbers
Line: 140
public function sanitize_numbercsv_field( $value ): string;
| Type | Name | Description |
|---|---|---|
string |
$value |
The field value. |
Returns: string — Sanitized value
sanitize_postids_field()
Sanitize CSV fields which hold post IDs
Line: 150
public function sanitize_postids_field( $value ): string;
| Type | Name | Description |
|---|---|---|
string |
$value |
The field value. |
Returns: string — Sanitized value
sanitize_textarea_field()
Sanitize textarea fields
Line: 168
public function sanitize_textarea_field( $value ): string;
| Type | Name | Description |
|---|---|---|
string |
$value |
The field value. |
Returns: string — Sanitized value
sanitize_checkbox_field()
Sanitize checkbox fields
Line: 214
public function sanitize_checkbox_field( $value ): int;
| Type | Name | Description |
|---|---|---|
mixed |
$value |
The field value. |
Returns: int — Sanitized value
sanitize_toggle_field()
Sanitize toggle fields
Line: 226
public function sanitize_toggle_field( $value ): int;
| Type | Name | Description |
|---|---|---|
mixed |
$value |
The field value. |
Returns: int — Sanitized value
sanitize_multicheck_field()
Sanitize multicheck fields
Line: 236
public function sanitize_multicheck_field( $value ): string;
| Type | Name | Description |
|---|---|---|
array|int |
$value |
The field value. |
Returns: string — $value Sanitized value
sanitize_posttypes_field()
Sanitize post_types fields
Line: 248
public function sanitize_posttypes_field( $value ): string;
| Type | Name | Description |
|---|---|---|
array|int |
$value |
The field value. |
Returns: string — $value Sanitized value
sanitize_taxonomies_field()
Sanitize post_types fields
Line: 258
public function sanitize_taxonomies_field( $value ): string;
| Type | Name | Description |
|---|---|---|
array|int |
$value |
The field value. |
Returns: string — $value Sanitized value
sanitize_color_field()
Sanitize color fields.
Line: 268
public function sanitize_color_field( $value ): string;
| Type | Name | Description |
|---|---|---|
string |
$value |
The field value. |
Returns: string — Sanitized value
sanitize_email_field()
Sanitize email fields.
Line: 278
public function sanitize_email_field( $value ): string;
| Type | Name | Description |
|---|---|---|
string |
$value |
The field value. |
Returns: string — Sanitized value
sanitize_url_field()
Sanitize URL fields.
Line: 288
public function sanitize_url_field( $value ): string;
| Type | Name | Description |
|---|---|---|
string |
$value |
The field value. |
Returns: string — Sanitized value
sanitize_file_field()
Sanitize file fields, which hold the URL picked in the media browser.
Line: 298
public function sanitize_file_field( $value ): string;
| Type | Name | Description |
|---|---|---|
string |
$value |
The field value. |
Returns: string — Sanitized value
sanitize_password_field()
Sanitize password fields.
Line: 308
public function sanitize_password_field( $value ): string;
| Type | Name | Description |
|---|---|---|
string |
$value |
The field value. |
Returns: string — Sanitized value
sanitize_wysiwyg_field()
Sanitize WYSIWYG fields.
Line: 318
public function sanitize_wysiwyg_field( $value ): string;
| Type | Name | Description |
|---|---|---|
string |
$value |
The field value. |
Returns: string — Sanitized value
sanitize_html_field()
Sanitize HTML fields.
Line: 328
public function sanitize_html_field( $value ): string;
| Type | Name | Description |
|---|---|---|
string |
$value |
The field value. |
Returns: string — Sanitized value
sanitize_css_field()
Sanitize CSS fields.
Line: 338
public function sanitize_css_field( $value ): string;
| Type | Name | Description |
|---|---|---|
string |
$value |
The field value. |
Returns: string — Sanitized value
sanitize_radio_field()
Sanitize radio fields against the options the field actually offers.
Line: 349
public function sanitize_radio_field( $value, $field = ... ): string;
| Type | Name | Description |
|---|---|---|
mixed |
$value |
The field value. |
array |
$field |
Field configuration array. |
Returns: string — Sanitized value
sanitize_select_field()
Sanitize select fields against the options the field actually offers.
Line: 360
public function sanitize_select_field( $value, $field = ... ): string;
| Type | Name | Description |
|---|---|---|
mixed |
$value |
The field value. |
array |
$field |
Field configuration array. |
Returns: string — Sanitized value
sanitize_radiodesc_field()
Sanitize radio fields that carry a description per option.
Line: 371
public function sanitize_radiodesc_field( $value, $field = ... ): string;
| Type | Name | Description |
|---|---|---|
mixed |
$value |
The field value. |
array |
$field |
Field configuration array. |
Returns: string — Sanitized value
sanitize_thumbsizes_field()
Sanitize thumbnail size fields.
Line: 390
public function sanitize_thumbsizes_field( $value, $field = ... ): string;
| Type | Name | Description |
|---|---|---|
mixed |
$value |
The field value. |
array |
$field |
Field configuration array. |
Returns: string — Sanitized value
sanitize_sensitive_field()
Sanitize sensitive fields.
Line: 436
public function sanitize_sensitive_field( $value, $key ): string;
| Type | Name | Description |
|---|---|---|
string |
$value |
The field value. |
string|array |
$key |
The field key. |
Returns: string — Sanitized value
sanitize_repeater_field()
Sanitize repeater field.
Line: 467
public function sanitize_repeater_field( $value, $field = ... ): array;
| Type | Name | Description |
|---|---|---|
mixed |
$value |
Array of repeater values (may be non-array from form data). |
array |
$field |
Field configuration array. |
Returns: array — Sanitized array
get_incomplete_repeater_rows() static
Find repeater rows that fail their own required-field rules.
Purely structural - returns what is wrong, not a human message, so it carries no i18n.
Line: 583
static public function get_incomplete_repeater_rows( array $rows, array $field ): array;
| Type | Name | Description |
|---|---|---|
array |
$rows |
Sanitized repeater rows, as returned by sanitize_repeater_field(). |
array |
$field |
Repeater field configuration. |
Returns: array — Map of row index => issue, where issue may have a ‘missing’ key
str_putcsv() static
Convert a string to CSV.
Line: 649
static public function str_putcsv( $input_array, $delimiter = ..., $enclosure = ..., $terminator = ... ): string;
| Type | Name | Description |
|---|---|---|
array |
$input_array |
Input string. |
string |
$delimiter |
Delimiter. |
string |
$enclosure |
Enclosure. |
string |
$terminator |
Terminating string. |
Returns: string — CSV string.
sanitize_tax_slugs() static
Resolve taxonomy slugs to term taxonomy IDs.
Line: 706
static public function sanitize_tax_slugs( &$settings, $source_key, $target_key ): void;
| Type | Name | Description |
|---|---|---|
array |
$settings |
The settings array containing the taxonomy slugs to sanitize. |
string |
$source_key |
The key in the settings array containing the slugs. Pattern is Name (taxonomy:term_taxonomy_id). |
string |
$target_key |
The key in the settings array to store the sanitized term taxonomy IDs. |
Returns: void