Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'Hide Admin'

Viewing 25 results - 226 through 250 (of 691 total)
  • Author
    Search Results
  • #253893
    danleachuk
    Participant

    I am attempting to hide the “Delete Group” sub nav item in Groups >> Manage, using the following code in bp-custom.php

    if(!current_user_can(‘administrator’)){
    bp_core_remove_subnav_item( bp_get_current_group_slug() . ‘_manage’, ‘delete-group’ );

    }}

    This does delete the item. However it has an unusual side-effect I don’t understand:

    groups/test/admin/ brings up a 404 error (without the code above, this brings up the Manage >> Details tab)
    groups/test/admin/edit-details still works after I type it in manually.

    How can I fix this?

    I have a fresh WP and BP install. Twenty-Sixteen theme.

    justarandomuser
    Participant

    I just found a little problem on my website.
    As an admin I can edit directly on the Front-End the profiles of my users if there is bad data.

    I show the fields like this (I have only 1 group):

    <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
    // many things are going on here! but nothing special
    <?php enwhile; ?>

    The problem is… EMPTY fields are not in the output!

    I tried to put array('hide_empty_fields' => 0) into bp_the_profile_field() but this doesn’t work.

    I handle everything (display of the profile, editing of the profile fields etc) in <my-theme>/buddypress/members/single/cover-image-header.php

    Please help me 🙁

    #253283
    semperaye
    Participant

    There is this code posted by someone on this thread 2.5 years ago:

    https://buddypress.org/support/topic/hide-certain-admins-as-being-online/

    /* disable Recording Site Activity for Admins */
    add_action(“bp_loaded”,”bpdev_init_sm_mode”);
    function bpdev_init_sm_mode(){
    if(is_super_admin())
    remove_action(“wp_head”,”bp_core_record_activity”);//id SM is on, remove the record activity hook
    }
    /* ——————————————– */

    But not sure if that is custom css, or if that is something that needs to be placed in the bp-custom.php file? Also, that code appears to only block admin activity, not profile, and members list….

    Is there a way to do all of this via some custom CSS? That would obviously be the easiest way to solve this since there are no currently working plugins.

    #252534
    mln83
    Participant

    Hi guys,

    I am running some tests on my site and found a few deprecated functions and recommendations for the BuddyPress plugin:

    Unsafe/buddypress/bp-groups/bp-groups-actions.php view source
    base64_decode at line 141:
    $bp->groups->completed_create_steps = json_decode( base64_decode( stripslashes( $_COOKIE['bp_completed_create_steps'] ) ) ); 
    Potential risk: High. Decode data encoded with MIME base64. May be used to obfuscate (hide) malicious code. Often paired with eval function to execute malicious code.
    DeprecatedUnsafe/buddypress/bp-forums/bbpress/bb-includes/functions.bb-core.php view source
    force_ssl_login at line 566:
    ( ( $context & BB_URI_CONTEXT_BB_USER_FORMS ) && force_ssl_login() ) // Force https when required on user forms 
    Deprecated 4.4.0 Use force_ssl_admin()

    For a full report, I suggest you take a look at Plugin Inspector – https://wordpress.org/plugins/plugin-inspector/

    Best regards,
    Michael

    Kookidooki
    Participant

    Hello guys,

    How do I hide “+New” button,located at top bar, from members?

    I only want administrators getting access to add new postings, media, etc.

    I want something like this (I’m not a coder):

    if ( ! is_user_logged_in() ) {
    add_filter( ‘show_new’, ‘__return_false’ );
    }

    Thank You!

    #252295
    shanebp
    Moderator

    You mean group admins?

    I don’t think group admins can leave a group.

    To remove the ability to delete groups for everyone except site admins, try:

    function janhart_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(
    		'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( 'You are not allowed to delete this group.', 'error' );
    		bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) );
    	}
    }
    add_action( 'bp_actions', 'janhart_remove_group_admin_tab', 9 );

    The capabilities you want to adjust are not related to WP roles.

    damagomez
    Participant

    Hello, im having problems with the registration and activity pages on my website, im new at this, so i dont know if i’ve made a mistake and where i might have made it…

    I installed buddypress through wordpress plug-in search engine, and then went to settings and set up everything as i wanted, edited the profile fields as i needed, and then when i tried to visit the pages i only get the title of the page and the rest is blank, as if it where a normal page.

    I’ve been searching different forums about people having the same problem, but i haven’t been able to find a solution, they’ve either been posted a lot of years ago, or they just say solved and do not share how they solved it.
    If anyone can help, i will appreciate it a lot!!

    I have read the codex as many suggested, but it did not help because i did everything as it indicate to do it.
    I created the register and activate page and then assigned them under Settings/Buddypress/Pages, how the codex indicates so. (i did not edit in any way the pages, i only created and assigned them.
    I made sure that in Settings/General under membership the “anyone can register” is checked.
    I’ve checked if the register.php and activate.php files do exist.
    I read that it might be a bug, so i tried uninstalling this version (V2.5.2) and installing V2.5.1 and V2.3.5, just in case that would fix it…

    I truly don’t know what else to do.
    Its my first website and i do not know a lot of coding, im learning as i go.
    Could it be a bug in the plug-in? if so… how can i fix it?

    Just in case it helps, my host company is hostgator, WordPress is updated to the lates version, so is buddypress.

    I have the following plug-ins installed (i know they are a lot, but since i do not know how to code, i sort of need them…) :

    Admin Custom Login
    Black Studio TinyMCE Widget
    Black Studio Touch Dropdown Menu
    BP Registration Options
    BuddyPress
    BuddyPress Cover Photo
    BulletProof Security
    Confirm User Registration
    Contact Form 7
    Duplicate Post
    Hide Admin Bar From Non-admins
    Lightbox Plus Colorbox
    Meta Slider
    No Right Click Images Plugin
    Page Builder by SiteOrigin
    PMPro KISSmetrics
    Polylang
    Protect My Contents
    Quick Page/Post Redirect Plugin
    SB Welcome Email Editor
    SiteOrigin Widgets Bundle
    Spacer
    Title Remover
    Wordfence Security
    WordPress Access Control
    WP Bouncer
    WP Maintenance Mode

    Thanks in advance for your help!

    Kieran
    Participant

    I’m looking to set up moderation through my BuddyPress install. I’ve looked at the permissions and no matter what I try I seem to come up empty handed – any thoughts on what permissions I would give to a user to allow them to delete others activity from the front end. I will have my site set up in such a way that the user (any level other than super admin) cannot see the back end.

    Further, I have set up a user called flag, (I have hidden flag from being visible anywhere on the site, and when a user attempts to go to the URL they’re forwarded to the support page I have setup) I wish to have their notifications forwarded to anyone who has X role or to a set of user ID’s that can delete said post if it offends.

    I used the above code to achieve the hidden user https://buddypress.org/support/topic/hide-admin-from-members-and-activity/#post-190874

    Does anyone have any thoughts on this? I’m pretty stuck.

    Thanks,

    Kieran

    #251886
    giilour
    Participant

    hi – I have a multi author website and want people to be able to view authors profiles. I also have subscribers – is there a way to deny access for people to view subscribers profiles even if they type in the full web address and username?

    I found this code for admins and am using it atm – is there a way to have it for subs as well.

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

    gnosis123
    Participant

    I am wanting to hide the notification alert ( that sits in the admin bar ) when it has a 0 count. Tried many css but nothing works.

    .count no-alert {
    display:none!important;
    }

    graeme_bryson
    Participant

    I’m looking to exclude a single user ID from the main activity feed only. Directly above the main feed, I’m using a shortcode to pull in the latest post from this same single user, thus creating a ‘sticky’ post as this account only posts announcements. However, the code below seems to hide the user’s content across the entire site, so it doesn’t appear in either the shortcode-generate feed or the main feed.

    Essentially, is there a way I can specifically target the main buddypress activity feed only with this exclusion? Thanks in advance for any help you can provide.

    // 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 );
    #251280
    @mcuk
    Participant

    Yeah it’s possible 🙂 (assuming that the bit you are talking about is the one im thinking of haha).

    Two methods:

    1. CSS

    li#wp-admin-bar-site-name {
        display: none;
    }

    2. Add this to functions.php file

    function remove_site_name( $wp_admin_bar ) {
    	$wp_admin_bar->remove_node( 'site-name' );
    }
    add_action( 'admin_bar_menu', 'remove_site_name', 999 );

    Both will hide the word for both ALL users including admins (I prefer the second but its up to you).

    If you want to leave the word Pretitude there for admins only to access the dashboard then adding an if statement into the function (similar to the one in the remove_admin_bar() function) should work.

    Hope it works!

    #251278
    Georgio
    Participant

    Sorry, I didn’t explain it well: I want to keep the admin bar for non-admins (it is usefull for the notifications etc) but make disappear the word “Pretitude” (that gives access to dashboard).
    Well, after using your code, non-admins don’t have access to dashboard any more, but the word Pretitude stays visible and points to the home page. This word been now useless, I want to hide it for esthetical reasons, because it is near the logo and the whole thing is ungly. Is that possible?

    Thanks again for the code!

    #251238
    Georgio
    Participant

    With your code and the use of the plugin Better Admin Bar I have made a nice unobtrusive admin bar.
    Any idea how to hide/remove the dashboard link for NON-admins? Thanks.

    screenshot

    #251115
    shanebp
    Moderator

    Try:

    function bpfr_hide_admins_profile() {
    
    	if( bp_is_user() )
                if ( bp_displayed_user_id() == 1 && bp_loggedin_user_id() != 1 ) 
    		bp_core_redirect( home_url() );
    
    }
    add_action( 'wp', 'bpfr_hide_admins_profile', 1 );
    #251113
    maelga
    Participant

    Hi, I’m using the below snippet from @danbp

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

    When enabling WP_DEBUG, I get the following errors:

    • Use of undefined constant bp_is_profile – assumed ‘bp_is_profile’ in …/fonctions.php in line 291
    • Undefined property: stdClass::$id in …/fonctions.php in line 291

    Although the redirect works fine, is there any way to resolve these 2 errors?

    #250762
    @mcuk
    Participant

    This might help (change ID from 1 in the appropriate places to the ID of your administrator(s). ID’s found in your database ):

    https://buddypress.org/support/topic/hide-all-admins-from-all-buddypress-activities/

    #250727
    blogook
    Participant

    Hi,

    You can use the code from buddydev. You just have to change one single thing

    <?php
    //filter on pre_user_query
    add_action( 'pre_user_query', 'devb_exclude_loggedin_user', 201 );
    
    function devb_exclude_loggedin_user( $query ) {
        // code below we do not need
        //don't modify the query if the user is not logged in
        // if ( !is_user_logged_in() )
        //    return;
    
        //do not hide users inside the admin
        if ( is_admin() && !defined('DOING_AJAX') )
            return;
        $qv = $query->query_vars;
    
        global $wpdb;
        //hide little change at the end of the query.I changed it to user_id : 1
        // but userID can be anything. I chose 1 because that is my admin user_id
        $query->query_where .= $wpdb->prepare(" AND {$wpdb->users}.ID !=%d ", 1 );
    }
    ?>
    RONO2
    Participant

    Hide Admin Bar Toolbar is what I used. I’m still trying to link my buddypress with my bbpress not going over well. LoL Hope this helps.

    #249827
    jino01
    Participant

    So there are two things I need to do:
    1) Hide admin mentionname somehow
    2) Members to have name and last name instead of the mentionname, maybe this will help with point 1?

    #249233
    Kookidooki
    Participant

    Thank you!

    It works fine, but when a (non-administrator) user is logged in, they cannot log out anymore because the logout button is missing which you can find in the “Howdy… [name][avatar][settings][logout button]” box at the upper right side. Also missing is the name of the user with his avatar, messages / notifications, etc. So this box is missing.

    So what I need is a script that hides the admin bar on the front end when you’re logged out, but is visible when you’re logged in.

    Any idea?

    ThanX!

    #248850
    Slava Abakumov
    Moderator

    All fields that are in the first Base fields groups will appear on registration page.
    So you can just move those fields to another fields group, that you can create on this page /wp-admin/users.php?page=bp-profile-setup using this link http://cosydale.com/wp-admin/users.php?page=bp-profile-setup&mode=add_group.

    Another option

    Find the ID of a field that you want to hide in admin area (when you edit the field it’s in the URL like this /wp-admin/users.php?page=bp-profile-setup&group_id=1&field_id=2&mode=edit_field = field_id=2 is what you need), make sure that this field is NOT required, then open style.css of your theme and add there something like this:
    #profile-details-section.register-section .editfield.field_2 {display:none}
    For reference: http://take.ms/lONUD

    #248412

    In reply to: Private Pages Glitch?

    fscbmwcca
    Participant

    I know the plugin doesn’t address my issue but keeps BuddyPress for members only and hide it from non-logged in users. Privacy is very important to our members. I will upload the members that are truly members from a csv file from a list that is provided for me and give the Contributor Role. What I meant by subscriber is the “Subscriber” Role (vs Contributor, Author, Editor, Administrator).
    I’m sorry I haven’t expressed myself well and now off topic. I was just trying to provide a solution for making pages private.

    #247818
    buckyb
    Participant

    Thank you for replying, I tried to figure it out on my own, but I cant get it to work. I changed some of the lines, and included what you have, but it breaks the site. (still learning, please bear with me)

    function bpfr_hide_profile_field_group( $retval ) {
    $displayed_user_level = some_s2_function( bp_displayed_user_id() ); 
    if( is_super_admin() && $displayed_user_level == 'access_s2member_level1' )  {
    // exlude groups, separated by comma
    		$retval['exclude_groups'] = '6,5';          		
    	} 
    	return $retval;	
    }
    add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_field_group' );
    #247706
    shanebp
    Moderator

    The above is wrong – unless you are using the bp-default theme – not recommended.

    ‘Hide’ the Create a Group link by turning it off in Groups Settings > Group Creation
    .../wp-admin/admin.php?page=bp-settings

Viewing 25 results - 226 through 250 (of 691 total)
Skip to toolbar