select
field type to store a field with a defined value or values
Create the select
field type using
You appear to be a bot. Output may be restricted
bw_register_field( "_oikp_type", "select", "Plugin type", array( '#options' => bw_plugin_types() ) ); bw_register_field_for_object_type( "_oikp_type", "oik-plugins" );
Form display
When displayed in the Fields meta box or [bw_new] it appears either as a single selection drop down list or a multi-selection drop down list, depending on the value of the#multiple
option.
bw_fields display
When displayed by [bw_fields] it appears like this.Notes
The select type may be optional ("#optional" => true
).
If the possible set of values is dynamic then you should consider using a custom taxonomy ( tags or category ) instead of a custom field.
Related
- bw_form_field_select() – bw_form_field_select – formatting for a field as a select list
- bw_theme_field_select() – Theme a field of type ‘select’