تخطي الملاحة

Open

Topic Tags: Compatibility

Overview of the issue

If you remove the wpml_manage_media_translation capability with Publishpress Capabilities plugin, you will notice that users are still able to access the WPML Media Translation section.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Open your theme’s function.php file.
  • Add the following code:
    // WPML Workaround for compsupp-7344
    function wpml_compsupp7344_disable_wpml_media_translation_menu() {
        // Check if the current user lacks the required capability
        if (! current_user_can('wpml_manage_media_translation')) {
            // Remove the WPML Media Translation menu
    		remove_submenu_page( 'tm/menu/main.php', 'wpml-media' );
        }
    }
    
    add_action('admin_init', 'wpml_compsupp7344_disable_wpml_media_translation_menu');
    

ترك رد

يُرجى البقاء في الموضوع والتزام الاحترام للآخرين. إذا كنت بحاجة إلى مساعدة بشأن المشكلات التي لا تتعلق بهذا المنشور، فاستخدم منتدى الدعم لبدء محادثة أو إرسال تذكرة.

يمكنك استخدام هذه العلامات:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>