Support » Plugin: Theme and plugin translation for Polylang (TTfP) » Choose wich role can access translation page

  • Resolved xellagm

    (@xellagm)


    Hello,

    I’ll be wonder if it could be possible to create filter, or add a setting in the plugin configuration in dashboard, to choose wich capacity of user to use in this function (file theme-translation-for-polylang.php) :

    function process_polylang_theme_translation() {
    if (Polylang_TT_access::get_instance()->is_polylang_page()) {
    if (Polylang_TT_access::get_instance()
    ->chceck_plugin_access() && current_user_can(‘manage_options‘)) {
    $plugin_obj = new Polylang_Theme_Translation();
    $plugin_obj->run();
    }
    }
    […]
    }

    I would like to use “edit_posts” capability and not “manage_options”.

    Is it possible for you to add this functionnality ?

    Thank you !

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Marcin Kazmierski

    (@marcinkazmierski)

    Hi @xellagm ,

    I have added filter and at now you can manage it in your function.php like:

    add_filter('ttfp_translation_access', 'custom_ttfp_translation_access', 10, 1);
    function custom_ttfp_translation_access(bool $hasAccess):bool
     {
         return current_user_can('edit_posts');
     }

    Please update plugin to latest the version: 3.4.0.

    Thread Starter xellagm

    (@xellagm)

    Thank you so much for your answer and the code modification ! It’s perfectly working !

    Thanks again for you great work on this plugin !

    Plugin Author Marcin Kazmierski

    (@marcinkazmierski)

    2candela2

    (@2candela2)

    hello and thanks for the plugin.

    i have tried the code

    add_filter('ttfp_translation_access', 'custom_ttfp_translation_access', 10, 1);
    function custom_ttfp_translation_access(bool $hasAccess):bool
     {
         return current_user_can('edit_posts');
     }

    but editors cant see the menu and if they go to the link it says that they don’t have permissions. could you make a capability so it can be managed by Members, please? thanks

    Plugin Author Marcin Kazmierski

    (@marcinkazmierski)

    hello @2candela2 and thank you for your issue.

    Can you describe your problem in more detail?

    I can hide the menu for users who do not have access – will it be enough ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Choose wich role can access translation page’ is closed to new replies.