프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$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. |
메소드 | 설명 | |
---|---|---|
__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. |
메소드 | 설명 | |
---|---|---|
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 | ||
리턴 | array | list of meta boxes to remove |
public add_options ( array $options ) : void | ||
$options | array | |
리턴 | void |
public form_data_element ( $data_row, mixed $value ) | ||
$value | mixed |
public form_data_elements ( mixed $value ) : string | ||
$value | mixed | |
리턴 | string | HTML |
public preload_alter_values ( array $values ) | ||
$values | array |
public presave_all ( $values, $current_values ) : mixed[] | ||
리턴 | mixed[] | sanitized values |
public presave_alter_values ( int[] $values, int[] $current_values = [] ) : int[] | ||
$values | int[] | |
$current_values | int[] | |
리턴 | int[] | $values |
public array $first_element | ||
리턴 | array |
public array $options | ||
리턴 | array |
public string $options_template | ||
리턴 | string |