This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Disabling WPML admin module to client

  • Creator
    Topic
  • #7287
    Martin
    Participant

    Hi Jason,

    is there any way to disable WPML options (the last item which appears under the WPML menu when WPMP Bridge plugin is installed) in similar way to this?

    Thanks,
    Martin

Viewing 8 replies - 1 through 8 (of 8 total)
  • Author
    Replies
  • #7291
    Jason Bobich
    Keymaster

    Hello Martin,

    Maybe something like this in your Child theme would do it:

    [see code snippet below]
    #7296
    Martin
    Participant

    Hello Jason,
    tried this, but it unfortunatelly does not work…

    #7298
    Jason Bobich
    Keymaster

    Try it like this:

    function my_remove_wpml_settings_page(){
    	remove_action( 'admin_menu', 'tb_wpml_add_admin_page', 999 );
    }
    add_action( 'init', 'my_remove_wpml_settings_page' );
    #7300
    Martin
    Participant

    hmmm… still does not work…

    #7301
    Jason Bobich
    Keymaster

    You’re putting it in the functions.php of your Child theme? Working on my end? The 999 priority on the remove_action was the key for me.

    #7302
    Martin
    Participant

    Sure Jason,

    I am looking at your function tb_wpml_admin_page_init in theme-blvd-wpml-bridge.php of the plugin and even if I disable add_action( 'admin_menu', 'tb_wpml_add_admin_page', 999 ); in line 933 of this file, the menu is still here.
    It seems that you use another method of addying menu item, since there is your comment // Old way of setting up options page manually

    #7306
    Jason Bobich
    Keymaster

    Sorry I completely got themes mixed up. I didn’t see we were on Jump Start.

    Ok, so if you just want to disable it all together, I think you could only unhook the entire function there.

    remove_action('init', 'tb_wpml_admin_page_init');

    Also, there’s a filter there “tb_wpml_settings_cap” you can use to change the capability (currently “edit_theme_options”) of the page if you want to take that route.

    http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table

    For example, if your client is not a super admin, you could change it like:

    function my_wpml_settings_cap($cap){
    	return 'manage_sites'; // Change to Super admin
    }
    add_filter( 'tb_wpml_settings_cap', 'my_wpml_settings_cap' );
    #7328
    Martin
    Participant

    It works!
    Thank you Jason for great support!

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.