acf-to-rest-api
acf-to-rest-api copied to clipboard
Where to activate show/edit in rest filters
Hi, I'm trying to active the filters per:
https://github.com/airesvsg/acf-to-rest-api#editing-the-fields
Could you elaborate on which file to add the following code in order to active the filter options:
`// Enable the option show in rest add_filter( 'acf/rest_api/field_settings/show_in_rest', '__return_true' );
// Enable the option edit in rest add_filter( 'acf/rest_api/field_settings/edit_in_rest', '__return_true' );`
I know it says admin, but is there a specific file? I tried several but it did work. Thanks
Hi,
Copy and paste in your functions.php
https://github.com/airesvsg/acf-to-rest-api#field-settings
Thanks
Thanks for the quick response. I copied the following into funcitons.php:
// Enable the option show in rest
add_filter( 'acf/rest_api/field_settings/show_in_rest', '__return_true' );
// Enable the option edit in rest
add_filter( 'acf/rest_api/field_settings/edit_in_rest', '__return_true' );
I still don't see the filter options to show/edit field in rest. Is there additional php that needs to be added?
Thanks
Hi @tjb1187, What's the directory name of your ACF plugin? Thanks
I think same problem here. I included those filters, not cached. But do not see any changes. What would be the end point to get the list of options? So let's say for countries select field I have multiple options, how do I get the list of available options? I thought this would be a common question but apparently not, what do people usually do then?
Yes, I cannot see the options to show/edit field in rest either. I copied the filters into functions.php.
same problem here, plugin settings and acf options show/edit are not available.
Hi @mruknowme,
Please, open a new issue for your doubts.
The options here is not a endpoint, but in the field group into admin.
If you search for closed issues, maybe you will find some answer.
Thanks
Could be php caching? I wasn't seeing any change after editing my functions.php page. Took me a while to work out that you have to restart php after each edit if you have php opcache turned on. Doh!!