I'm trying to use carbon fields to retrieve a list of product categories from woocomerce in a select but hooking the fields registration on the init with 0 priority makes this impossible since the product_cat taxonomy is registered later and it's trowing me an "Invalid Taxonomy" error.
Can you please tell me if removing the 0 priority will brake anything in the plugin or if there it's another solution to make this work?
Select field supports callback. For any options that are not static, is recommended to load with callback, since this improves performance with a lot when listing all posts or in your case - all terms.
Thank you for sharing the knowledge, it works.
Just to add an example to what @pkostadinov-2create said (for future reference):
// your options file ...
Field::make( 'select', 'crb_category', 'Category' )
->add_options( 'my_product_categories_options' )
// somewhere in functions.php, for example ...
function my_product_categories_options() {
$category_options = [array: term id => term name];
return $category_options;
}