Limit Translator use to certain groups only

There’s not currently a way to limit a plugin to only a specific group, it could be added as a feature to any individual plugin, but would take a little work.

Without adding functionality to the existing plugin, this could be done within a theme…

We have a theme component that adds all of a user’s groups to the body tag: CSS Classes for Current User's Groups

Using this you could hide the translator button for all users that aren’t in a specific group:

body:not(.group-example) {
  .post-controls .translate {
    display: none; 
  }
}

In that example, the translate button below a post would be hidden for anyone not in the “example” group.

A savvy visitor could discover the translate button in their browser’s inspector, so it’s not as comprehensive as a solution directly in the plugin, but it might work well enough for your case.

5 Likes