Hello, everyone,
I need help in realizing client requirements.
Within the ACF group, I’ve created three fields (primary_tags, secondary_tags, and other_tags), all of which are of type taxonomy (tag). “Create terms” is set to “switch on,” return value is “term object,” and appearance is set to “multi-select.” These fields are displayed on the posts.
My client requests that only administrators can add new primary and secondary tags to the list, while other users can only add tags that already exist in the list. As for the “other_tags” field, it is open to all users.
If you have any ideas on how this could be achieved, please send me your suggestions. Thank you in advance!
You need to use an acf/load_field filter for the fields you want to change. In your filter you will check the current user role and set $field['add_term']
to true or false as needed.
Thank you so much, this is helped me… works fine
@hube2
Hello John,
do you know how I could solve the following request that follows up on my previous question?
I need to list posts in the recommended reading section on a single use-case page based on tags (primary, secondary, and other) that the current use case being read contains. The tag can be in any category (primary_tags, secondary_tags, and other_tags); they don’t have to belong to the same category. The posts should be displayed in the order of primary, secondary, and then others.
Thank you in advance!
The only way to do that would be to have 3 different queries for posts based on the terms selected in each of the taxonomy fields.