Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'Hide Admin'

Viewing 25 results - 126 through 150 (of 909 total)
  • Author
    Search Results
  • #269331
    HDcms
    Participant

    Hello Gorges
    And thank you 🙂

    In fact, I want to hide these tabs to everyone except for a wordpress role and the super admin
    It works (a priori) but do not hesitate to suggest an improvement.
    I am not sure of my code!

    Regards

    add_action('wp_head', 'HD_maj_activite');
    function HD_maj_activite() {
    	$bp_loggedin_user_id = bp_loggedin_user_id();
    	$user_info = get_userdata($bp_loggedin_user_id);
    	$user_roles = $user_info->roles;
    	if (is_super_admin() || in_array('membre2', $user_roles)) 
     	return ;
    	$output .= '<style type="text/css">body.activity.directory #activity-friends {display: none;}</style>';
    	$output .= '<style type="text/css">body.activity.directory #activity-groups {display: none;}</style>';
       echo $output; // 
    }
    Kookidooki
    Participant

    Hello Boone,

    Thank you for your input.

    I’ve checked permission status of uploads: 755.

    Cleared all caches, Cloudflare, and pauzed SSL but still no luck with the posting of updates or uploading of images in posts, activity stream or in Media Library (shows a blank page, no thumbnails, etc.).

    But on top of this I’ve found other (probably related) problems:

    1. Even our administrators couldn’t create new user accounts or update existing accounts. All we see is an avatar, no name, email, no edit,etc. See image below:

    users

    2. Database error:
    WordPress database error: [Duplicate entry ‘0’ for key ‘PRIMARY’] 
INSERT INTO kuyrsd79sdn_bp_activity ( user_id, component, type, action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide, is_spam ) VALUES ( 82, ‘activity’, ‘activity_update’,

    MySQL said:
    #1062 – Duplicate entry ‘0’ for key ‘PRIMARY’

    3 SQL query:


    — Indexes for table kuyrsd79sdn_options

    ALTER TABLE kuyrsd79sdn_options
    ADD PRIMARY KEY (option_id),
    ADD UNIQUE KEY option_name (option_name),
    ADD KEY wpe_autoload_options_index (autoload)

    Any idea how to fix this?

    naomibuch
    Participant

    Hi Again,

    This is a list of all my plugins:

    WP Mail SMTP
    WP Crontrol
    WP All Import Pro
    WordPress Mass Email to users
    WordPress Importer
    W3 Total Cache
    tagDiv Social Counter
    tagDiv Composer
    SiteOrigin Widgets Bundle
    Shortcodes Ultimate
    rtMedia for WordPress, BuddyPress and bbPress
    RSS Importer
    Remove Dashboard Access
    PushLive – Staging Site to Live Site in One Click
    Page Builder by SiteOrigin
    Newsletter
    Knowledge Base for Documents and FAQs
    Invite Anyone, by Boones 🙂
    iframe
    Hide This
    Hide Admin Bar
    Easy Affiliate Links
    Contact Form 7
    Buddypress Shortcodes
    Buddypress Friend of a Friend (FOAF)
    BuddyPress Follow
    BuddyPress Extended Friendship Request
    BuddyPress Edit Activity
    BuddyPress Block Activity Stream Types
    BuddyPress Activity ShortCode
    BuddyPress Activity Privacy
    BuddyPress Activity Filter
    BuddyPress Activity Autoloader
    BuddyPress
    BP Show Friends
    Amazon Auto Links
    All In One SEO Pack Pro
    Akismet Anti-Spam
    Advanced Profiles Plugin 2.0 for BuddyPress
    Activity Reactions For Buddypress

    #269152
    DragoWeb
    Participant

    Hi, I have this error message

    “There was a problem cropping your profile photo.”

    when I try to upload an avatar image with a width of 450px and above. Starting to 451px it works (even with an height of 150px). I get a warning message only if I try to upload an image under 150x150px :

    “You have selected an image that is smaller than recommended. For best results, upload a picture larger than 150 x 150 pixels.”

    So, I suppose this problem doesn’t come from a setting option somewhere.

    The problem is the same when I switch to the default theme Twenty Fifteen and I have no other plugin activated (except HideMySite). Cover image works without problem. Cropping image works with Ultimate-member plugin and in WP admin -> Media -> Edit/crop as well.

    Config:
    Wordpress (new install) v4.9
    Buddypress 2.9.2
    php 5.6
    GD enabled

    Thanks.

    tackleb0x
    Participant

    Hello,

    I would like to modify the default Member’s page to remove the “bp_member_latest_update”. Currently the page shows the list of members, not including the “Admins”. I achieved this by adding the following function to the functions.php page:

    add_filter( 'bp_after_has_members_parse_args', 'buddydev_exclude_users_by_role' );
     
    function buddydev_exclude_users_by_role( $args ) {
        //do not exclude in admin
        if( is_admin() && ! defined( 'DOING_AJAX' ) ) {
            return $args;
        }
    
        $excluded = isset( $args['exclude'] )? $args['exclude'] : array();
    
        if( !is_array( $excluded ) ) {
            $excluded = explode(',', $excluded );
        }
    
        $role = 'administrator';//change to the role to be excluded
        $user_ids =  get_users( array( 'role' => $role ,'fields'=>'ID') );
    
        $excluded = array_merge( $excluded, $user_ids );
    
        $args['exclude'] = $excluded;
    
        return $args;
    }

    The page shows the default behavior: Avatar, Name, Latest Activity (with a link that reads “view”), and the last active time.

    I would like to remove/hide the latest activity (including the word “view”) from the list altogether. Any ideas on how I could achieve this? Perhaps with a snippet to add to the functions.php file?

    I have the following installed:
    BuddyPress – 2.9.1
    WordPress – 4.8.2
    Theme – Buddy (child)

    I appreciate any help in advance!

    Max
    Participant

    Hi moefahmy,

    That’s actually a clever solution to address this issue. The difference with me is that my customer needs a few specific groups to be restricted to only let himself post in it. But since only administrators like my customer needs to post I can target only the administrator role to view the post-an-update form, and hide them for every other user role. I can code something to make this only happen on the groups I want it to.

    Thanks for activating the bulb inside my brain haha, I really appreciate this solution. Well done!!

    #268412
    ariktwena
    Participant

    Hi

    I really need some help here. I have different user-roles on my website, but I want to exclude a specific user-role from showing up on the overall activity page/feed.

    I forund this code where the admin is excluded:

    
    // 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 == 784  ) {			
    
    			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 );
    

    So i’m hoping someone can help me adjust it. I need for the users that have the user-role ‘Banditter’ && ‘Participant’ not to show up on the overall activity feed, but for them to see their own activity. Plus for the Admin to see all activity

    I don’t know so much PHP, so i’m hoping for some help 🙂

    Thanks

    #268397
    Kristian Yngve
    Participant

    Oh sorry, I had copied it as is by the other moderator from a very old post. Thank you for cleaning that up for me, this should be the only one as a How to & Troubleshooting category.

    So, I did the changes and it didn’t work. I also tried changing the last part: hide_admins_profile’, 1 ); to hide_admins_user’, 1 ); but didn’t work sadly… resorted back to profile for that part.

    Any other suggestions that may work? I had also cleared the cache after any changes.

    #268389
    Kristian Yngve
    Participant

    Just over 3 years ago, the moderator, Danbp, had the once working code that went straight into your bp-custom.php file:

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

    **However, this no longer works with all those updates to the plugin.

    Anyone have an idea on what would be the up to date code that would work to actually deny all non-admin users access to admins profile?

    #268054
    xmginc
    Participant

    Hey guys,

    Would anyone know how to hide and disable member pages based on their role type. (e.g. yoursite.com/members/username)

    Goal: if a member is set to a WordPress Administrator role, we would like to make his/her page inaccessible from the public

    Purpose: while we have been able to hide specific roles from displaying in the member directory, their member/page is still visible if you know the URL.

    Similar to how we can make the WordPress Author page inaccessible, we’d like to do the same for BuddyPress’s equivalent Member page.

    Thanks in advance

    #268044
    xmginc
    Participant

    Update: we have found that with a multisite with multiblog enabled to share the member list from the parent across all the child sites, code to filter out roles such as “administrator” only work if that user is also added to the child site.

    Example:

    Does not work in this scenario:

    – parent site setup with user “johnadmin” with admin role is hidden on parent site directory
    – child site without this user created does not hide him from the site directory

    Works in this scenario:

    – parent site setup with user “johnadmin” with admin role is hidden on parent site directory
    – child site ALSO setup with user “johnadmin” with admin role is hidden on child site directory

    For anyone wondering, the code that is partially working for us is below found at buddydev.com. This code has been added to the functions.php in the child site so that we can control what the child site loop shows individually. (example: parent shows everyone, child 1 shows only subscribers, child 2 only shows x, child 3 only shows y, etc.)

    Would super appreciate any suggestions thx!

    add_filter( 'bp_after_has_members_parse_args', 'buddydev_exclude_users_by_role' );
     
    function buddydev_exclude_users_by_role( $args ) {
        //do not exclude in admin
        if( is_admin() && ! defined( 'DOING_AJAX' ) ) {
            return $args;
        }
        
        $excluded = isset( $args['exclude'] )? $args['exclude'] : array();
     
        if( !is_array( $excluded ) ) {
            $excluded = explode(',', $excluded );
        }
        
        //$role = 'administrator';//change to the role to be excluded
        $user_ids =  get_users( array( 'role__in' => ['administrator' , 'contributor' , 'author', 'editor'] ,'fields'=>'ID') );
        
        $excluded = array_merge( $excluded, $user_ids );
        
        $args['exclude'] = $excluded;
        
        return $args;
    }
    
    xmginc
    Participant

    Hey guys,

    Wondering if there is a way to hide specific members based on a extended profile setting.

    While I see options for hiding based on WordPress user role (i.e. Admin, Author, etc.) or based on WordPress user’s ID #, I’m hoping we can do this via an option available to admins to change whether a member is visible in the directory.

    Also, we found that the options to hide users appear to work on the parent Buddypress but those settings don’t affect the child site in a multiblog/multisite setting.

    Any suggestions is greatly appreciated thanks!

    #267910
    TxGirl
    Participant

    That is the same visibility options that already come with BuddyPress. I need to be able to add the option to choose that the profile is viewable by editors or other member group that comes with wordpress. I don’t want to hide them from being editable by the user, I want to hide them from being seen by other members on when they view another members profile but want them to be seen by more than just admin’s (i.e.) I also need to allow editor’s to be able to see them when viewing a member’s profile.

    Kookidooki
    Participant

    Hey there,

    I would like to improve the security of my site and ploughed through this forum to find the right answer.

    Is there a way to hide the profiles of administrators site-wide?

    At this moment when an administrator creates a group, all visitors could see the profile of the admin. I would like to hide it; I want it only visible for other administrators in dashboard.

    Thanks in advance!

    Shaktimaan
    Participant
    add_filter( 'bp_get_send_message_button', function( $array ) {
        if ( friends_check_friendship( bp_loggedin_user_id(), bp_displayed_user_id() ) ) {
            return $array;
        } else {
            return '';
        }
    } );

    I am using the above filter to hide private message button to non friends. It works but it also hides private message button to site admins and bbpress moderators. I want site admins and bbpress moderatos (bbp_moderator) could send and receive private messages even if they are not friend.

    Any solution?

    #266613
    slimmyweight
    Participant

    Isn’t there code somewhere I can just copy and paste as I tried using parts from the above forum post:

    I copy and pasted.
    https://buddypress.org/support/topic/hide-admin-from-members-and-activity/
    If not I guess I won’t be able to fix it without knowing how to code?

    #266611
    Henry Wright
    Moderator

    I’ve tried pasting … at the top of my current code and it is still the same showing an fatal error message and allowing me to view the admins profile.

    You will need to have a basic understanding of the code to get this done. The code you copied and pasted just limits the activity stream to 5 entries per page. It doesn’t filter admin entries or hide the admin’s profile.

    slimmyweight
    Participant

    Hi all,

    I’m new to buddypress and have no experience with php. I have how ever managed to follow instructions on previous posts on preventing users from seeing the admin profile and activity but it hasnt worked correctly and has come up with errors.

    I managed to create the bp-custom.php in the wp-content/plugins directory but the admin profile still appears and just comes up with an error message saying fatal error. It still allows the option to add as a friend aswell unless that might be to do with viewing it from an account already adding the admin account with.

    This is where I got the code Im using from:
    https://buddypress.org/support/topic/hide-admin-from-members-and-activity/

    Code in the bpcustom file

    
    <?php
    
    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 );
    
    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');
    
    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 );
    
    ?>
    
    #266247
    michent1
    Participant

    I’m hitting a bit of a brick wall here on how to hide (not completely remove) a Sub Nav title when users are viewing a profile that isn’t their own.

    I have a Parent Tab that displays the users Posts, with the following sub navs:
    – Approved
    – Pending
    – Drafts

    If we use the bp_core_remove_subnav_item function, it completely removes the components. Which poses as an issue when the component is the default landing for the parent tab (in this case, “Approved”).

    Obviously, this can easily be achieved by using some simple css, but that wouldn’t allow for the conditionals (i.e. !bp_is_my_profile()). So what I’m trying to do is create a conditional that only “hides” the Approved sub nav, still allowing for the post output in the item loop.

    Here’s a look at my code so far:

    
    /**
     *
     * Only show certain sub navs to profile owners
     *
     */
    
    function scrib_hide_profile_menu_tabs() {
    
    	if( bp_is_active( 'xprofile' ) ) :
    
    		if ( bp_is_user() && !is_super_admin() && !bp_is_my_profile() ) {
    			//bp_core_remove_subnav_item( 'wire_items', 'approved' );
    			bp_core_remove_subnav_item( 'wire_items', 'pending' );
    			bp_core_remove_subnav_item( 'wire_items', 'draft' );
    			//bp_core_remove_subnav_item( 'wire_posts', 'approved' );
    			bp_core_remove_subnav_item( 'wire_posts', 'pending' );
    			bp_core_remove_subnav_item( 'wire_posts', 'draft' );
    		}
    	endif;
    }
    add_action( 'bp_setup_nav', 'scrib_hide_profile_menu_tabs', 15 );
    
    //Hide sub navs some other way to prevent any conflicts with rendering default post display loop
    function scrib_hide_profile_sub_nav_title () {
    	if (bp_is_active('xprofile')):
    		if(bp_is_user() && !is_super_admin() && !bp_is_my_profile()) {
    
                       //Not sure how to hide without removing tab completely
    
    		}
    		endif;
    
    }
    add_action('bp_setup_nav', 'scrib_hide_profile_sub_nav_title');

    Any ideas?

    al3as06
    Participant

    Hi, I have to recount the members with this filter in function.php :

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

    There are 1 500 members (with admin), with this filter the counter should display 1 499 but it display 0, don’t understand why at all…

    #265619
    EMRETHEAVIATOR
    Participant

    The problem is solved. It was because of an old code I used to hide admin. Anyone needs to hide admin can use this link.

    lalitavalon
    Participant

    I useed the same website with diffrent link on local host it is working fine there is no issue.
    But I actaully try to set up the same website again on local differnt link and try to install the buddypress plugin getting errors and not able to uninstall.
    Still if you want some information please find below:

    Theme -custom theme
    php version 7.0.9
    Install type single
    List of plugins:

    Advanced Custom Fields
    Advanced Custom Fields: Date and Time Picker
    Advanced Custom Fields: Repeater Field
    All In One SEO Pack

    Breadcrumb NavXT

    BuddyPress
    Captcha

    Contact Form 7
    Dephue Data Design Hide Update Notifications – Developer Edition
    Limit Login Attempts
    Lockdown WP Admin
    Login With Ajax
    Restrict Categories
    Visualizer: Charts and Graphs
    WP-Mail-SMTP
    WPFront User Role Editor

    Host Type: Local

    zsauce
    Participant

    This is the bar and menu I am trying to get rid of:
    WordPress Admin Bar

    While this is the bar I’m trying to maintain, but all of these options disappear when I hide the WordPress Admin Bar above:
    BuddyPress Admin Bar

    zsauce
    Participant

    Hello everyone!

    I’ve been searching for hours on every site I can possibly think of, and I’ve looked at tons of articles in regards to the admin bar, but haven’t found any similar issues.

    The website I am currently building I am using BuddyPress version 2.8.2, BuddyBoss theme version 2.3.3, and WordPress version 4.7.4.

    I want to hide the WordPress admin bar from all users except the administrator. That’s simple, as I have found many different ways to do it (coding, plugins, etc).

    The issue I am running into is when I hide the WordPress admin toolbar (regardless of method, ie. coding or plugin), it also removes all of the dropdown options for the BuddyPress admin toolbar (activity, profile, friends, messages, etc) that shows up with the BuddyBoss theme. I originally thought it was a coding issue in the BuddyBoss theme, but from the information I found, the admin bar that shows up with the theme comes from the BuddyPress plugin.

    I imagine that the BuddyPress plugin uses the same call function (I don’t code much so I don’t know the proper term) to get it’s drop down menu as WordPress does for it’s admin toolbar. My issue is I can’t figure out where/what that is so that I can change it to something custom.

    Any assistance would be greatly appreciated.

    #265408
    Johninbc
    Participant

    I administer two social sites and both are asking of there is any way to remove notifications of people joining the group and who made friends with whom… It is plugging up the group notification area and users are getting annoyed.
    I have searched for appropriate plugins and found a few but all are depreciated and mess up the site.
    Wordpress 4.7.3
    Buddypress 2.8.2
    Bbpress 2.5.12

    I found a code hack for the functions.php but it can’t be used in the child “guideline” theme. When added to the child, I lose admin pages. code snippet below

    // Remove (hide) various activities from streams.
    function my_hidden_activities($a, $activities) {
    //if admin we want to know
    //if (is_site_admin())
    // return $activities;

    $nothanks = array(“new_blog_post”, “created_group”, “joined_group”, “new_member”, “friendship_created”, “activity_liked”);

    foreach ($activities->activities as $key => $activity) {
    if (in_array($activity->type, $nothanks, true)) {
    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’, ‘my_hidden_activities’, 10, 2 );

    The author suggests adding to functions.php but without using the child theme the code would be lost after an update. It also broke the site… Even after reverting the changes, the menu and page formatting was gone.

    Is there any way that is up to date to filter what activity is reported on the group wall?

Viewing 25 results - 126 through 150 (of 909 total)
Skip to toolbar