Because I’m actually moving Metabox Fields to ACF Fields, I need to limit ACF fields groups by my user_id (I’m not the only admin so I can’t use the “Current user role” dropdown option). There is a hook to achieve this?
Thank you
You can do this by building a custom location rule. The example currently given in the documentation is for user ID https://www.advancedcustomfields.com/resources/custom-location-rules/
Thank you @hube2 for your answer.
This example is working for my case, but now, all my frontend forms based on acf_form() disapeared?
You will need to set up alternate location rules. I would create another location rule, for example this one https://github.com/Hube2/acf-filters-and-functions/blob/master/is_admin-acf-location-rule.php
Then use
(is_admin AND user id =) OR !is_admin
hope that makes sense
I’m sorry but this doesn’t seems to work.
I’m the same user in front and backend, and my rule match is only “ID based”.
Here is my code.
Last thing very strange, frontend only shows the submit button, and not the rest of the form … 🙁
Without this location rule, my frontend form is ok (but my backend form need to be displayed only for me).
Thank you for your help.
I just did a test with my first suggestion and copied the code in the example. It’s working for me as expected.
When calling acf_form() are you including any options?