Support

Account

Home Forums Feature Requests Default value for the taxonomy field type Reply To: Default value for the taxonomy field type

  • I just tried this and the example I gave still seems to be working.

    This if for checkbox/multiselect field type

    
    add_filter('acf/load_field/key=field_589c6d5477f05', 'set_tax_default');
    function set_tax_default($field) {
    	$field['default_value'] = array(3,4);
    	return $field;
    }
    

    and this works for radio and single select

    
    add_filter('acf/load_field/key=field_589c6d5477f05', 'set_tax_default');
    function set_tax_default($field) {
    	$field['default_value'] = 3;
    	return $field;
    }
    

    The value needs to match the term ID(s) of the default values you want to set.