You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I try to filter the list of categories of the products received by the rest api.
I add 'myfield' as ACF field.
With the plugin ACF-to-rest-api I can see the field in the rest api result under acf : {}
I suppose there is a filter or an action to add in the functions.php file but everything I tried returned all the categories without any filter.
What’s also strange, for the products, I can see in the rest api result the metadata with the values added by ACF
For the category, the metadata aren’t visible.
In the database the values are stored in termmeta for the categories and in postmeta for the products.
If I’m right, the product is a post and the category is a taxonomy.
Thanks in advance,
The text was updated successfully, but these errors were encountered:
Hello,
I try to filter the list of categories of the products received by the rest api.
I add 'myfield' as ACF field.
With the plugin ACF-to-rest-api I can see the field in the rest api result under acf : {}
This url returns all the categories.
https://mywebsite/wp-json/wc/v3/products/categories/
I want to be able to filter a custom field added by ACF
https://mywebsite/wp-json/wc/v3/products/categories/?myfield=testvalue
Could someone help me ?
I suppose there is a filter or an action to add in the functions.php file but everything I tried returned all the categories without any filter.
What’s also strange, for the products, I can see in the rest api result the metadata with the values added by ACF
For the category, the metadata aren’t visible.
In the database the values are stored in termmeta for the categories and in postmeta for the products.
If I’m right, the product is a post and the category is a taxonomy.
Thanks in advance,
The text was updated successfully, but these errors were encountered: