• Resolved doubleedesign

    (@doubleedesign)


    Hi there,

    I have set Stream to administrators only, but on this particular site I needed to give Editors manage_options capability to access a certain plugin.

    Now Editors can see and edit the Stream settings in the dashboard, though they can’t see the actual stream.

    To simply hide it I tried the following but it didn’t work:

    function my_menu_page_removal() {
    	if ( !current_user_can('delete_plugins') ) {
    		remove_menu_page('admin.php?page=wp_stream');
    		remove_submenu_page( 'admin.php?page=wp_stream', 'admin.php?page=wp_stream_settings');
        	}
    }
    add_action( 'admin_menu', 'my_menu_page_removal', 11 );

    and also just:

    function my_menu_page_removal() {
    	if ( !current_user_can('delete_plugins') ) {
    		remove_menu_page('admin.php?page=wp_stream_settings');
        	}
    }
    add_action( 'admin_menu', 'my_menu_page_removal', 11 );

    Neither worked.

    Any suggestions appreciated!

    https://wordpress.org/plugins/stream/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter doubleedesign

    (@doubleedesign)

    Ok, figured it out!

    I needed to use:

    remove_menu_page( 'wp_stream' );

    Instead of the full URL including admin.php?etc.

    Thread Starter doubleedesign

    (@doubleedesign)

    Although I will add this isn’t ideal because if the Editor knows it’s there, they can still access it via the URL – this only hides it from the dashboard menu.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘If an Editor has manage_options capability, they can see Stream settings’ is closed to new replies.