Skip to:
Content
Pages
Categories
Search
Top
Bottom

Link to administration in menu


  • beat sk
    Participant

    @beatwell

    Hello,

    I have a question about buddypress profile menu. How can i make a link in the menu only for userroles? Something like “Go to administration” in the profile menu – Profile, Activity, Groups, Messages ? Is there a chance to add this only for user roles and admins? Register and Login working on front-end and we want hide /wp-admin from others. Thank you.

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

  • shanebp
    Moderator

    @shanebp

    Rather than create a link for certain roles, just add a redirect for anyone who has a role not approved for access to wp-admin. There are lots of examples of this, google it.

    For example, this will send everyone, other than admins, to the home page if they try to visits wp-admin:

    function beatwell_block_users_backend() {
    	if ( is_admin() && ! is_super_admin() && ! wp_doing_ajax() ) {
    		wp_redirect( home_url() );
    		exit;
    	}
    }
    add_action( 'init', 'beatwell_block_users_backend' );

    beat sk
    Participant

    @beatwell

    this probably isn’t what I’m looking for. I have done “access” through the plugin which is with the my theme. Since the site is focused on game news, so I only want the authors and our staff get into the administration with link in the “menu” (not site menu, just buddypress menu, where is ajax login and there are items like “Profile, Activity, Groups, Messages and Logout etc.” I just want to add something to this menu like “Administration” which will be seen only by our staff and visitors will no see it.

    Something like that

    Thank you for your reply btw.


    beat sk
    Participant

    @beatwell

    Nothing?

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