• Resolved Haim

    (@koostamas)


    Hello! I have just started to use Pods today. It’s useful, thanks.

    Our (under construction) website has 3 languages. We would need a user field what can be displayed in all 3 languages. So, when it is modified, the content is visible on the given page’s 3 languages versions. How to create this field?

    The above field could be modified only by the admin and another person. This person will have only one task, one capability: to modify this field. How to restrict this user to get only this one permission?

    Thanks and greetings

    Tamás

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Paul Clark

    (@pdclark)

    Both multilingual data and user permissions can quickly become complex. Here are some options that might fit with your workflow:

    Polylang historically has worked well with graphically configured custom data plugins, such as Pods. This might be a good fit.

    Loco Translate can be useful for changing translations when WordPress core internationalization functions are used.

    At a more foundational level display of a field across many languages depends on how the desired language is tracked.

    WordPress multisite is sometimes used for tracking multi-lingual content, where each site can be detected by blog ID, path, subdomain, or can have completely separate URLs. User permissions also comes along with this, where users can be given author or editor roles for individual sites within the network.

    Within a single site, one might track the current language with a URL paramter, such as ?lang=en, where that value would then be accessible in PHP as $_GET['lang'], or one might set a cookie based on other URL structures, buttons, user actions, or by detecting the default language of the browser or country of origin for the requesting user.

    Having “only one permission,” such as editing one field, can get tricky. The easiest solution is to make a frontend page, such as with [pods form="1"] shortcode, so then user permissions can be limited to that page, separate from wp-admin.

    Within wp-admin, there is a user capabilities and user roles field for Permissions in each field’s advanced options within Pods. The trick is that one would have to define all the things the user *cannot* edit to have a permissions configuration where only one field were editable.

    Another broad by applicable route to permissions within wp-admin, in addition to per-field capabilities, is to hide menu items with CSS and restrict wp-admin pages by URL. This requires a mix of approaches, such as redirecting the user to the desired page at login, plugins such as LoginWP can do this, or redirecting the user if any URL in wp-admin is accessed other than the desired page: this requires a bit of custom programming such as on the admin_init or admin_menu hooks. If one wants an installation to be especially hardened, one would also need to filter requests to wp-admin/admin-ajax.php or /wp-json/ to make sure saves and other queries are not possible without appropriate authentication. The complexity of combining all these approaches is why a custom frontend field is often simpler.

    There are many plugins for editing WordPress users and capabilities, which are the formal system WordPress uses to define what a user is allowed to do. These can be assigned, or new permissions defined for use with the Pods capabilities fields or functions like current_user_can() with Pods Admin > Components > Roles & Capabilities.

    Thread Starter Haim

    (@koostamas)

    Dear Paul,

    I’m amazed by the complexity and the details of your answer. Thanks a lot!

    Yes, we run with Polylang. It seems to be working nicely.

    We are going to try out the options you wrote about. Thanks. Greetings

    Tamás

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to allow a user to do nothing else but edit a Pods field?’ is closed to new replies.