Skip to:
Content
Pages
Categories
Search
Top
Bottom

WordPress dashboard


  • supremor
    Participant

    @supremor

    Hi,

    I am wondering why – when logged in – a participant is able to see the WP dashboard? Not the admin one but still the dashboard? Is there a setting I need to change?

    Here is a screen shot of a participants page:

    Dashboard 1

    Dashboard 2

Viewing 3 replies - 1 through 3 (of 3 total)

  • Robkk
    Moderator

    @robkk

    see if this works

    add it to your function.php in your child theme or functionality plugin.

    /**
     * Disable admin bar on the frontend of your website
     * for subscribers.
     */
    function rkk_disable_admin_bar() { 
    	if( ! current_user_can('edit_posts') )
    		add_filter('show_admin_bar', '__return_false');	
    }
    add_action( 'after_setup_theme', 'rkk_disable_admin_bar' );
     
    /**
     * Redirect back to homepage and not allow access to 
     * WP admin for Subscribers.
     */
    function rkk_redirect_admin(){
    	if ( ! current_user_can( 'edit_posts' ) ){
    		wp_redirect( site_url() );
    		exit;		
    	}
    }
    add_action( 'admin_init', 'rkk_redirect_admin' );

    jsantana
    Participant

    @jsantana

    Hi @Robkk where do I add this code?


    Robkk
    Moderator

    @robkk

    @jsantana

    i said where in my above reply

    add it to your function.php in your child theme or functionality plugin.

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