Skip Navigation

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');
    

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>