I'm creating a form with an
entity_autocomplete field targeting taxonomy terms, and I would like to restrict it to a certain vocabulary. Is there a way to do that with
'#selection_settings'? I can't find any example.
This is the code I am using.
$form['p_cat_ac'] = array( '#type' => 'entity_autocomplete', '#title' => t('Product Category'), '#target_type' => 'taxonomy_term', '#selection_settings' => [ 'include_anonymous' => FALSE, ], );