Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'Hide Admin'

Viewing 25 results - 301 through 325 (of 915 total)
  • Author
    Search Results
  • Mickey
    Participant
    // deny access to admins profile. User is redirected to the homepage
    function bpfr_hide_admins_profile() {
    	global $bp; 
    	if(bp_is_profile && $bp->displayed_user->id == 1 && $bp->loggedin_user->id != 1) :
    		wp_redirect( home_url() );
    	exit;
    	endif;
    }
    add_action( 'wp', 'bpfr_hide_admins_profile', 1 );

    Hello, instead of home_url I would like it to redirect to a specific page on my site, when I insert that page, “http://mysite.com/contact” in place of home_url it doesnt work. What should I be putting there?

    Thanks!

    #238788
    danbp
    Participant

    Additionaly you can use/be inspired by this:
    https://buddypress.org/support/topic/hide-admins-activities-from-all-activity-feeds-in-buddypress/#post-223433

    Successfully tested on BP 2.2.3.1 WP 4.2.2 Twenty Twelve

    #238771
    micromart
    Participant

    I’m trying to remove the admin user and other users of the membership list. But all the solutions researched here in the forum have not worked.
    I was wondering if it was because of the recent update of WordPress.

    Does anyone have any solution to help?
    thank you

    Snoogasm
    Participant

    Hello, I was wondering if there was a way to allow user roles other than admins to mark users as spammers. Actually, more generally I’d like them to be able to edit the extended user profiles granted by BuddyPress from both the front and backend. Now, this is possible by granting a user role the manage_options permission, but the problem is that they also have access to many other important options from WordPress and third party plugins. Even if I were to hide links in the navigation bar, a savvy user could still work his way into those options. I’d like to be able to manage ONLY the Buddypress options, including the ability to mark spammers.

    Any help would be much appreciated, thanks.

    #238546
    #238363
    danbp
    Participant

    Try if ( !is_super_admin( $current_user_id))

    Or use the WP filter

    function hide_my_admin_bar() {
    	// by user role
        if ( current_user_can( 'manage_settings' ) ) {
            return true; // Show for admins
        } else {
            return false; // Hide for other users
        }
    }
    add_filter( 'show_admin_bar', 'hide_my_admin_bar' );
    #238357
    @mcuk
    Participant

    I’ve set up two users to test various things on site during development, one with Administrator and one with Subscriber roles. That’s what the wp dash is confirming under users.

    I also have another function to hide the wp admin bar at the top of the page which includes the is_super_admin(). When its active, the admin bar is removed for the subscriber but not the admin user as intended. So can only assume that there is a problem with my redirect function itself or perhaps its clashing with something else (though I have no other plugins atm).

    //Remove wordpress admin bar for all except admin 
    function bpmc_remove_admin_bar() {
    	if( !is_super_admin() ) 
    		add_filter( 'show_admin_bar', '__return_false' );
    }
    add_action('wp', 'bpmc_remove_admin_bar');
    dreddurius
    Participant

    WP: 4.1.1 (not multi-site)
    BP: 2.2.1
    Theme: Twenty Fifteen
    Plugins activated: Akismet

    Link: ClubBnb

    Hi everybody.

    I recently installed Buddypress (first time) for a travel-community site and all was running smoothly. An hour ago I accidentally overwrote the site’s wp-config.php with my local (vanilla) version. I managed to get it up and running again but I found that the posts, authors, users and other pertinent details are missing from the blog. I checked out the DB at PhpMyAdmin (Godaddy) and saw that they are still there.

    Prior to this I backed up my DB (1,500-ish posts and 60+ users who’ll be after my hide when this isn’t resolved so I’m getting my passport ready just in case 😀 ).

    I’m stumped now so I might as well ask for help from you guys (while I grab a beer that I do not deserve).

    For now I’ll try to recreate the site in my local machine using the most recent DB backup and see what’ll happen.

    If you need more specifics just let me know.

    Thanks guys.

    danbp
    Participant

    hi @mcpeanut,

    this snippet useable from BP 2.0.1 and above, can be added to bp-custom.php
    it will hide the field ID 1 which is the default Name field to all, except site admin.

    it will also avoid the user to edit that field. So if you use this, i recommand you tell them on register page that once they entered a name it they could change it later. You can than ask them $$$$ to do it. 😀

    function bpfr_hide_profile_field_group( $retval ) {
    	if ( bp_is_active( 'xprofile' ) ) :	
    	
    	// hide profile group/field to all except admin	
    	if ( !is_super_admin() ) {		
    		//exlude fields, separated by comma
    		$retval['exclude_fields'] = '1';  
    		//exlude field groups, separated by comma
    		$retval['exclude_groups'] = '1'; 			
    	} 
    	return $retval;		
    	
    	endif;
    }
    add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_field_group' );

    More here:

    Using bp_parse_args() to filter BuddyPress template loops

    #236828
    booknerds
    Participant

    Well, the database modification did no change – the members were displayed anyway. And the php coding stuff is mainly for hiding users with a special user role. What I am looking for is to be able to select any user I want to hide, no matter if that user is admin, subscriber or whatever.

    danbp
    Participant
    Mickey
    Participant

    I have my admin bar and dashboard hidden by a plug in, but if they know what to type in the url they can still access some parts of admin functions. What is the best way to hide everything admin related from users, Im sure Im not the only one with this concern.

    #236225
    danbp
    Participant
    Tulesi
    Participant

    In addition to the admin bar on top right, buddypress member/author bar also shows to the right of my wp top menu(a custom nenu I created on dashboard). This added menu bar includes member avatar, Courses, Groups, Stats.

    I want to hide this member bar or hide/remove STATS(course-stats).

    Thank you for any help I can get

    rosyteddy
    Participant

    @minglonaire you can also try https://bp-tricks.com/design/easily-hide-specific-tabs-on-buddypress-member-and-group-pages/ AND remove Activity from Themes > Menu in your wordpress admin dashboard

    Sven Lehnert
    Participant

    Hi @imath,

    In this topic you write that the function you provided should work with BuddyPress Version 2.2
    https://buddypress.org/support/topic/how-to-remove-tabs-from-group-admin-nav/#post-230995

    
    function turker_remove_group_admin_tab() {
    	if ( ! bp_is_group() || ! ( bp_is_current_action( 'admin' ) && bp_action_variable( 0 ) ) || is_super_admin() ) {
    		return;
    	}
    
    	// Add the admin subnav slug you want to hide in the
    	// following array
    	$hide_tabs = array(
    		'group-avatar' => 1,
    		'delete-group' => 1,
    	);
    
    	$parent_nav_slug = bp_get_current_group_slug() . '_manage';
    
    	// Remove the nav items
    	foreach ( array_keys( $hide_tabs ) as $tab ) {
    		bp_core_remove_subnav_item( $parent_nav_slug, $tab );
    	}
    
    	// You may want to be sure the user can't access
    	if ( ! empty( $hide_tabs[ bp_action_variable( 0 ) ] ) ) {
    		bp_core_add_message( 'Sorry buddy, but this part is restricted to super admins!', 'error' );
    		bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) );
    	}
    }
    add_action( 'bp_actions', 'turker_remove_group_admin_tab', 9 );
    

    There is still one issue with the manage link like named from @danbp

    The normal link is groups/GROUP-SLUG/admin/ and it will become a 404

    groups/GROUP-SLUG/admin/edit-details/ will work.

    How can I change the manage link to groups/GROUP-SLUG/admin/edit-details/

    or better do you have a working solution? Hope you can help.

    Cheers,
    Sven

    #235444
    whoaloic
    Participant

    Hello danbp, I bring up the topic because I still struggle to hide administrators in member tabs.
    Any help would be really appreciated.

    #235367
    Klosurdo
    Participant

    Hi,

    I am really struggling with trying to hide my admins from my site. I searched this site and tried every code available with no success. Below is the last code I tried with no success.
    https://buddypress.org/support/topic/hide-admins-activities-from-all-activity-feeds-in-buddypress/
    Any ideas what I am doing incorrectly? This code is inserted in my child themes fuction.php correct?

    I am racking my brain on this one!

    Thanks for any help,
    Ken

    The Theme I am using is KLEO by Seventh Queen
    Buddy Press version Version 2.2.1
    Website:http://www.cmpg-annex.org/

    Other Plugins
    Akismet
    bbPress
    BuddyPress Cover Photo
    K Elements
    MOJO Marketplace
    Paid Memberships Pro
    PMPro MailChimp Integration
    PMPro Register Helper
    PMPro Set Expiration Dates
    Register Helper Example
    Revolution Slider
    rtMedia Pro for WordPress, BuddyPress and bbPress
    The Events Calendar
    WPBakery Visual Composer

    // deny access to admins profile. User is redirected to the homepage
    
    function bpfr_hide_admins_profile() {
    	global $bp; 
    	if(bp_is_profile && $bp->displayed_user->id == 1 && $bp->loggedin_user->id != 1) :
    	wp_redirect( home_url() );
    	exit;
    	endif;
    }
    add_action( 'wp', 'bpfr_hide_admins_profile', 1 );
    
    // Remove admin from the member directory
    
    function bpdev_exclude_users($qs=false,$object=false){
    	
    	$excluded_user='1'; // Id's to remove, separated by comma
    	
    	if($object != 'members' && $object != 'friends')// hide admin to members & friends 
    	return $qs;
    	
    	$args=wp_parse_args($qs);
    	
    	if(!empty($args['user_id']))
    	return $qs;	
    	
    	if(!empty($args['exclude']))
    	$args['exclude'] = $args['exclude'].','.$excluded_user;
    	else
    	$args['exclude'] = $excluded_user;
    	
    	$qs = build_query($args);
    	
    	return $qs;
    	
    }
    add_action('bp_ajax_querystring','bpdev_exclude_users',20,2);
    
    // once admin is removed, we must recount the members !
    
    function bpfr_hide_get_total_filter($count){
    	return $count-1;
    }
    add_filter('bp_get_total_member_count','bpfr_hide_get_total_filter');
    
    // hide admin's activities from all activity feeds
    
    function bpfr_hide_admin_activity( $a, $activities ) {	
    	
    	// ... but allow admin to see his activities!
    	if ( is_site_admin() )	
    	return $activities;	
    	
    	foreach ( $activities->activities as $key => $activity ) {	
    		// ID's to exclude, separated by commas. ID 1 is always the superadmin
    		if ( $activity->user_id == 1  ) {			
    			
    			unset( $activities->activities[$key] );			
    			
    			$activities->activity_count = $activities->activity_count-1;			
    			$activities->total_activity_count = $activities->total_activity_count-1;			
    			$activities->pag_num = $activities->pag_num -1;				
    		}		
    	}		
    	// Renumber the array keys to account for missing items 	
    	$activities_new = array_values( $activities->activities );		
    	$activities->activities = $activities_new;	
    	
    	return $activities;
    	
    }
    add_action( 'bp_has_activities', 'bpfr_hide_admin_activity', 10, 2 );
    #235293
    rosyteddy
    Participant

    Hi @danbp This is pretty cool, fun and useful.

    If bp org can add to
    About Plugins Themes Documentation **Snippets** Blog Support Download
    Snippets that actually work with WP4.1.1, and BP2.2x or BP 2.3 it will be an excellent and useful addition. Infact, users with some repu/creds can be allowed to post such snippets in this section, which can then be rated, commented or tagged. Making it a subsection of forum will make it less prominent but a tab by the side of plugins will be great.

    PS: Just curious, is there any such easy code that hides items from the left side nav bar in the site admin’s backend dashboard ?

    #235251
    Klosurdo
    Participant

    Thanks for the reply danbp,

    The Theme I am using is KLEO by Seventh Queen
    Buddy Press version Version 2.2.1

    I am looking to hide menu items for non logged in visitors in members profiles See example here.. I want to have only the “media” menu and possibly the documents icons viewable to non logged in visitors.

    I would like all icons viewable to only those members that are logged in.

    Thanks

    Other Plugins
    Akismet
    bbPress
    BuddyPress Cover Photo
    K Elements
    MOJO Marketplace
    Paid Memberships Pro
    PMPro MailChimp Integration
    PMPro Register Helper
    PMPro Set Expiration Dates
    Register Helper Example
    Revolution Slider
    rtMedia Pro for WordPress, BuddyPress and bbPress
    The Events Calendar
    WPBakery Visual Composer

    #235132
    whoaloic
    Participant

    Hey,
    I’ve found how to hide admin member in member menu but not in group menu in member tabs.
    More specifically: site admin (user ID 1) is admin of groups A, B, C.
    I would love the admin be hidden in member tab of groups A and B, but still be visible in member tab of group C.

    #235021
    danbp
    Participant

    Hello,

    please try to search in topics if a similar question wasn’t ask in the past.
    hide+admin+in+admin

    A possible solution here.

    whoaloic
    Participant

    Hello,
    As an administrator, I manage group and I am listed in some group list members.
    How to hide me in the list of members for all groups except one?

    Cheers.

    #234672
    mikewelsh
    Participant

    I am using the SweetSate theme, a dating/matching theme which is built on Buddypress.

    Instead of people searching for people with profile fields, I want to match people with universities/colleges.

    I have my colleges entered in through my admin.

    I want students to register on the site but I do not want them visible to anybody else.

    I only want the universities/colleges to be visible.

    How can I do this?

    In the search box for University Locations I can have Medchool – UK or Medschool – Overseas, but it also includes a null/blank field. I want blank fields in all the other search fields but not this one. If all the fields are blank it finds and displays all members.

    Site can be seen here: http://hotzoc.com/medical-schools/

    I have colleges registered as site role contributors and site users who sign up as subscribers.

    Is there any way I can restrict the search only to my ‘contributors’ group not the ‘subscribers’ group?

    I want users registered if possible so I can contact them and monitor their profile preferences. I cannot do this if I do not allow registration and just have my colleges as the only registered users.

    Any ideas or help greatly appreciated.

    #234665
    Matthias
    Participant

    I have a bbpress install where all user can edit their profile in the frontend.
    So I can hide the admin bar and all users can change password, public name and so on…

    THE PROBLEM:
    When I activate buddypress, the users only can edit their profile in the wordpress backend.
    All attempts to edit the userprofile in the buddypress frontend redirect me to 404.

    Can anybody help. I would like to use buddypress, but without user access to my wordpress backend…

    Thanks
    Matthias

Viewing 25 results - 301 through 325 (of 915 total)
Skip to toolbar