WordPress.org

Ready to get started?Download WordPress

Forums

White Label CMS
[resolved] Hide settings page from clients (2 posts)

  1. NeiltheSpacechimp
    Member
    Posted 1 year ago #

    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/

  2. NeiltheSpacechimp
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.