Hi,
I define a new taxonomy field with a radio button:
[...]
'fields' => array (
array (
'key' => 'field_5301cc2930b53',
'label' => 'Catégorie',
'name' => 'catgorie',
'type' => 'taxonomy',
'instructions' => 'my instructions',
'required' => 1,
'taxonomy' => 'category',
'field_type' => 'radio',
'allow_null' => 0,
'load_save_terms' => 1,
'return_format' => 'object',
'multiple' => 0,
),
[...]
But whatever I do (I tried ‘default_value’ => 0, ‘default_value’ => 1, ‘default_value’ => 2, ‘default_value’ => ‘name_of_category), I can’t have my radio button checked by default.
How could I achieve that?
Thanks,
LH
PS: Not sure where to put this thread. Sorry if I did a mistake.
Just ran into this need as well. +1
For anybody else that finds this, I ended up using this solution: wordpress.mfields.org/2010/set-default-terms-for-your-custom-taxonomies-in-wordpress-3-0/.
If you add your taxonomies manually in functions.php, maybe take a look here first: wordpress.stackexchange.com/a/7171/50427.