Settings_Sanitize
Settings Sanitize Class.
Namespace: WebberZone\Contextual_Related_Posts\Admin\Settings
Source: includes/admin/settings/class-settings-sanitize.php line 20
Methods
__construct()
Main constructor class.
Line: 45
public function __construct( $args );
| Type | Name | Description |
|---|---|---|
mixed | $args | { |
get_option()
Get the value of a settings field.
Line: 64
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()
Miscellaneous sanitize function
Line: 80
public function sanitize_missing( $value ): string;
| Type | Name | Description |
|---|---|---|
mixed | $value | Setting Value. |
Returns: string — Sanitized value.
sanitize_text_field()
Sanitize text fields
Line: 90
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: 100
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: 110
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: 120
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: 130
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: 148
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: 194
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: 206
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: 216
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: 228
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: 238
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: 248
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: 258
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: 268
public function sanitize_url_field( $value ): string;
| Type | Name | Description |
|---|---|---|
string | $value | The field value. |
Returns: string — Sanitized value
sanitize_sensitive_field()
Sanitize sensitive fields.
Line: 279
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: 310
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
str_putcsv() static
Convert a string to CSV.
Line: 417
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
Processes category/taxonomy slugs and adds a new element to the settings array containing the term taxonomy IDs.
Line: 474
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