Support

Account

Home Forums Backend Issues (wp-admin) Tag Management in WordPress: Role-Specific Restrictions

Solving

Tag Management in WordPress: Role-Specific Restrictions

  • The client requested that tags within a post be divided into 3 groups: Primary tags, Secondary tags, and Other tags.
    I have created an ACF Group containing 3 taxonomies: Primary, Secondary, and Other.
    Furthermore, it was requested that only administrators can add new tags to all 3 groups, while all other users can only add tags to Others. This has also been implemented.
    The only issue is that, for example, when a user with an editor role adds a new tag to Others, the same user can select that tag from the dropdown menu within Primary tags.
    How can this be prevented?

    Thank you in advance!

  • Preventing this would be complicated.

    You would need to add custom javascript to ACF and use the ACF JS API select2_ajax_data filter and include the values selected in the other fields to the AJAX request and then use an acf/fields/taxonomy/query or acf/fields/taxonomy/wp_list_categories filter to alter the the terms that are returned by the AJAX request for each field.

  • @hube2, thank you very much for your response.

    Hmm… this really sounds complicated. Could this be presented in another way, or could the tags be grouped differently, as they all currently go into one list?

    Is there another way to accomplish everything that the client has requested from me, maybe I’ve chosen a more difficult path?
    How would you approach this?Sorry, but can you explain it to me briefly?

  • The problem is that WP does not have a mechanism to do what is wanted. There might be a better approach, but I don’t really understand the purpose for the different types tags or how they are used to categorize posts.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.