Property | Type | Description | |
---|---|---|---|
$data | array | Full option data, allows grouping | |
$first_element | array | Always prepend this element to the $data | |
$grouped | boolean | Is the data grouped? E.g. should we use | |
$multiple | boolean | Allow multiple selections? | |
$options | array | Shortcut to data which allows a simple associative array | |
$options_template | string | Path to an options template to load. |
Method | Description | |
---|---|---|
__construct ( string $label = '', mixed $options = [] ) | Add CSS, construct parent | |
add_options ( array $options ) : void | Add options | |
form_data_element ( $data_row, mixed $value ) | A single element for a single bit of data, e.g. ' | |
form_data_elements ( mixed $value ) : string | Generate form elements. | |
option_selected ( string $current_option, array $options, string $attribute ) : string | Helper for output functions to toggle a selected options | |
preload_alter_values ( array $values ) | Alter values before rendering | |
presave ( mixed $value, $current_value = [] ) : sanitized | Presave function, which handles sanitization and validation | |
presave_all ( $values, $current_values ) : mixed[] | Override presave_all to handle special cases associated with multiple options fields. | |
presave_alter_values ( int[] $values, int[] $current_values = [] ) : int[] | Presave hook to set taxonomy data, maybe | |
sanitize ( array | string $value ) : array | string | Sanitize function that can handle arrays as well as string values. |
Method | Description | |
---|---|---|
add_meta_boxes_to_remove ( &$meta_boxes_to_remove ) : array | Helper function to get the list of default meta boxes to remove. | |
add_option_data ( string $name, mixed $value, string $group = null, string | integer $group_id = null ) : void | Add option data to the data attribute of this object |
public __construct ( string $label = '', mixed $options = [] ) | ||
$label | string | |
$options | mixed |
protected add_meta_boxes_to_remove ( &$meta_boxes_to_remove ) : array | ||
return | array | list of meta boxes to remove |
public add_options ( array $options ) : void | ||
$options | array | |
return | void |
public form_data_element ( $data_row, mixed $value ) | ||
$value | mixed |
public form_data_elements ( mixed $value ) : string | ||
$value | mixed | |
return | string | HTML |
public preload_alter_values ( array $values ) | ||
$values | array |
public presave_all ( $values, $current_values ) : mixed[] | ||
return | mixed[] | sanitized values |
public presave_alter_values ( int[] $values, int[] $current_values = [] ) : int[] | ||
$values | int[] | |
$current_values | int[] | |
return | int[] | $values |
public array $first_element | ||
return | array |
public bool $grouped | ||
return | boolean |
public array $options | ||
return | array |
public string $options_template | ||
return | string |