Julien, thank you for quick response.
I’m currently using wpas_add_custom_taxonomy(), I looked up the code in the plugin and I can see your point. I agree it seems a better function to use.
I think I haven’t made my original question clear though. The appearance of field itself is not an issue, I was wondering how to add values to the dropdown — in other words: how to add <options> to the <select>? I couldn’t find any parameter in the $args array that mentions the option values.
Here is the default args array included in the add_field function for custom fields (the final function being called anyway):
/* Default arguments */
$defaults = array(
'callback' => 'text', // Field callback to display its content
'core' => false, // Is this a custom fields that belongs to the plugin core
'required' => false, // Is this field required for front-end submission
'log' => false, // Should the content updates of this field be logged in the system
'capability' => 'create_ticket', // Required capability for this field
'sanitize' => 'sanitize_text_field', // Sanitize callback for the field value
'save_callback' => false, // Saving callback if a specific saving method is required
'show_column' => false, // Show field content in the tickets list & in the admin
'column_callback' => 'wpas_cf_value', // Column callback function
'sortable_column' => false, // Not compatible with taxonomies
'filterable' => true, // Used for taxonomies only
'title' => '', // Nicely formatted title for this field
'placeholder' => '', // Placeholder to display in the submission form
'desc' => '', // Helper description for the field
/* The following parameters are users for taxonomies only. */
'taxo_std' => false, // For taxonomies, should it behave like a standard WordPress taxonomy
'label' => '',
'label_plural' => '',
'taxo_hierarchical' => true,
'update_count_callback' => 'wpas_update_ticket_tag_terms_count',
);
I don’t see any argument for the field values. Could you provide pointers on how to do that? (these options need to be separate from products)