Support » Plugin: White Label CMS » Hide settings page from clients

  • Resolved NeiltheSpacechimp

    (@neilthespacechimp)


    Hi,

    I use a custom user role for clients and just recently started using your plugin – Great work a real time saver.

    I have a couple of plugins I like to use that put options in the settings menu of the WP dashboard. My custom user role allows my clients to access the settings menu but I’d like to hide the settings for White Label CMS.

    I’ve tried adding this to my themes functions file but the link remains:

    // Remove white label cms options  for users who can't update core
    function remove_wlcms() {
        if( !current_user_can( 'update_core' ) ):
      remove_submenu_page( 'options-general.php', 'options-general.php?page=wlcms-plugin.php' ); // white label cms in settings
    
     endif;
    }
    add_action( 'admin_menu', 'remove_wlcms' );

    Where am I going wrong?
    Thanks

    http://wordpress.org/plugins/white-label-cms/

Viewing 1 replies (of 1 total)
  • Ahh I see what I did. The correct code for those who are also wondering about this is:

    // Remove white label cms options for users who can't update core
    function remove_wlcms() {
        if( !current_user_can( 'update_core' ) ):
      remove_submenu_page('options-general.php','wlcms-plugin.php' ); 
    
     endif;
    }
    add_action( 'admin_menu', 'remove_wlcms' );
Viewing 1 replies (of 1 total)
  • The topic ‘Hide settings page from clients’ is closed to new replies.