Support

Account

Home Forums General Issues Define a default taxonomy (radio button) Reply To: Define a default taxonomy (radio button)

  • You can try to add a filter that will select a default value if none is selected already. Perhaps something like this:

    add_filter('acf/load_value/name=your_taxonomy_field_name', 'set_default_taxonomy_selection', 10, 3);
    function set_default_taxonomy_selection($value, $post_id, $field) {
        // Check if the field has a value
        if (!$value && empty($_GET['post'])) {
            // Set the default term ID here
            $default_term_id = 7;
            $value = $default_term_id;
        }
        return $value;
    }