acf-to-rest-api icon indicating copy to clipboard operation
acf-to-rest-api copied to clipboard

Where to activate show/edit in rest filters

Open tjb1187 opened this issue 6 years ago • 8 comments

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

tjb1187 avatar Jul 14 '18 16:07 tjb1187

Hi,

Copy and paste in your functions.php

https://github.com/airesvsg/acf-to-rest-api#field-settings

Thanks

airesvsg avatar Jul 14 '18 17:07 airesvsg

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

tjb1187 avatar Jul 14 '18 17:07 tjb1187

Hi @tjb1187, What's the directory name of your ACF plugin? Thanks

airesvsg avatar Jul 30 '18 21:07 airesvsg

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?

mruknowme avatar Aug 10 '18 08:08 mruknowme

Yes, I cannot see the options to show/edit field in rest either. I copied the filters into functions.php.

ninaanatchkova avatar Aug 11 '18 03:08 ninaanatchkova

same problem here, plugin settings and acf options show/edit are not available.

Yab-kami avatar Aug 26 '18 07:08 Yab-kami

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

airesvsg avatar Aug 28 '18 22:08 airesvsg

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!!

robtoll avatar Jan 07 '21 12:01 robtoll