Search Results for 'Hide Admin'
-
AuthorSearch Results
-
September 1, 2013 at 3:32 pm #170721
In reply to: hide members
@mercime
Participant@famous You can limit who views the members directory page to the Site/Super Admin only by surrounding the members directory section using is_super_admin https://codex.wordpress.org/Function_Reference/is_super_admin then either echo message that the section is restricted or just redirect non-Admin users to another page if visitors try to use the members slug in your site.
August 11, 2013 at 6:08 am #169691In reply to: Feature request: Hide certain members
marmuel
ParticipantHi there,
I´ve added the code in the functions.php of my child-theme.
In the “Who´s online”-widget, I still see the super admins. Any ideas to hide them in the widget?
Thank you!
Cheers
MarcoAugust 8, 2013 at 12:23 am #169550In reply to: Feature request: Hide certain members
bp-help
Participant@merosler
If your adding php code I hope you have made a child theme as @philipstancil did because that is the proper way. I would never add custom code to a parent theme’s functions.php because if you update the theme then it may get overwritten. Anyway, make sure whenever you add code to functions.php it always needs to be between opening and closing php tags like this:<?php // Remove admin from directory add_action('bp_ajax_querystring','bpdev_exclude_users',20,2); function bpdev_exclude_users($qs=false,$object=false){ //list of users to exclude $excluded_user='1';//comma separated ids of users whom you want to exclude if($object!='members')//hide for members only return $qs; $args=wp_parse_args($qs); //check if we are listing friends?, do not exclude in this case 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; } //Remove admin from member count add_filter('bp_get_total_member_count','bpdev_members_correct_count'); function bpdev_members_correct_count($count){ $excluded_users_count=1; //change it to the number of users you want to exclude return $count-$excluded_users_count; } ?>August 7, 2013 at 10:02 am #169507August 6, 2013 at 2:55 pm #169454aces
ParticipantCould your problem be a copy/paste error?
You appear to be using
‘and’– they should all be'August 6, 2013 at 1:51 pm #169446Ishanna
ParticipantHallo @sbrajesh !
I tried use code:
add_action(‘bp_friends_setup_nav’,'bpdev_custom_hide_friends_if_not_self’); function bpdev_custom_hide_friends_if_not_self(){ if(bp_is_my_profile()|| is_super_admin()) return ; bp_core_remove_nav_item(‘friends’); }I copied and pasted the code into the ‘bp_custom.php’ file but it did not work for me.
I’m new to wordpress, html, php and css but I seem to find my way til now. Some advise please? I really need this option to work and I can’t find a plugin that cover this.Kind regards,
August 3, 2013 at 6:44 pm #169307In reply to: Turning off admin activity in "Activity streams"
aces
ParticipantJuly 31, 2013 at 6:51 am #169148In reply to: Feature request: Hide certain members
philipstancil
ParticipantCrazy that we both found this old thread within 12 hours of each other. I got it working with this code:
// Remove admin from directory add_action('bp_ajax_querystring','bpdev_exclude_users',20,2); function bpdev_exclude_users($qs=false,$object=false){ //list of users to exclude $excluded_user='1';//comma separated ids of users whom you want to exclude if($object!='members')//hide for members only return $qs; $args=wp_parse_args($qs); //check if we are listing friends?, do not exclude in this case 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; } //Remove admin from member count add_filter('bp_get_total_member_count','bpdev_members_correct_count'); function bpdev_members_correct_count($count){ $excluded_users_count=1; //change it to the number of users you want to exclude return $count-$excluded_users_count; }July 25, 2013 at 1:16 pm #168790In reply to: remove admin-bar
Developer ICAN
ParticipantIn the latest BuddyPress – 1.9 – i want to hide the admin bar but keep it for WP site users (editors, admins) that aren’t BP users? Is that possible?
July 23, 2013 at 2:19 pm #168629In reply to: Customize Group Admin subnavigation
David Cavins
KeymasterAs a hack I can hide them using css by adding this to my functions.php file:
function hide_group_admin_tabs($classes) { $user_id = bp_loggedin_user_id(); $group_id = bp_get_current_group_id(); if ( bp_is_groups_component() ) { if ( groups_is_user_admin($user_id, $group_id) ) { $classes[] = 'group-member-admin-cap'; } else if ( groups_is_user_mod($user_id, $group_id) ) { $classes[] = 'group-member-mod-cap'; } } return $classes; } add_filter( 'body_class', 'hide_group_admin_tabs', 98 );And then adding display:none; rules to the tabs. But I would like to handle the navigation the right way (and not with a css hack). Any ideas?
Thanks for your help,
-David
July 9, 2013 at 5:17 am #167792In reply to: How Do I Hide Extended Profile Fileds from Users
nobodymove
Participant@bphelp. I think I have discovered the culprit to this little mystery.. I have been using the Buddypress Members Import plugin: http://www.youngtechleads.com/buddypress-members-import/
For some reason when I import my database, the plugin does not seem to process the xProfile Field visibility settings properly.. The profile fields are still listed as “Admins Only” But for some reason they are still visible to all users.
Earlier, I manually added some new test profile fields and they worked fine. I also discovered, that if I edit, and re-save a user’s profile field after import, all profile fields for that user will then revert to the proper visibility settings.
I have contacted the plugin author to make him aware of the issue, hopefully he can fix it. If you have any suggestions that might be a quick fix for this I’m all ears! 🙂
July 8, 2013 at 8:57 pm #167767In reply to: How Do I Hide Extended Profile Fileds from Users
nobodymove
Participant@bphelp. Upon a little further research, I wanted to note that I created a new User Profile Group, created a private field seen by Admins Only in that group, and the settings seem to be working fine in that group. In my Base (Primary) group though, all profile fields still remain visible to all users. Does the Base (Primary) group automatically force all fields visibility public by default? If so, is there way to override?
If there is no way to change the visibility in the Base (Primary), I suppose I can just put private info in the other Profile Group, but I’m curious if or how that may effect my database import..
June 19, 2013 at 9:01 pm #166430In reply to: Hide Buddypress Profile based on Admin Field Value
shanebp
ModeratorWhile very doable, this will require custom coding.
You can contact me at PhiloPressJune 19, 2013 at 8:48 pm #166428In reply to: Hide Buddypress Profile based on Admin Field Value
dpeters
ParticipantWP Version: 3.5.1
BuddyPress: 1.7.2You want to ‘hide’ the profile page for a member who hasn’t paid their dues?
What should happen if that page is accessed by that member or another member?
Redirect? Custom message page ?Either redirect to a listing of all active members or display an error page would be fine, (i.e. “This member is not currently an active member.”)
If ‘paid dues’ is a boolean, then it’s easy to write a function.
Where is that boolean stored?It would be stored in their profile as an Admin-editable field, per the original post.
Does that member still appear on the Members page? In the Activity stream?
No to both. Hidden users would be able to login and update information but their profile wouldn’t be public-facing, just them and the admins.
This would be useful as we have staggered dues, allowing profiles to turn off/on.
June 19, 2013 at 8:41 pm #166426In reply to: Hide Buddypress Profile based on Admin Field Value
shanebp
ModeratorYou need to state which versions of WP & BP you use.
You want to ‘hide’ the profile page for a member who hasn’t paid their dues?
What should happen if that page is accessed by that member or another member?
Redirect? Custom message page ?If ‘paid dues’ is a boolean, then it’s easy to write a function.
Where is that boolean stored?Does that member still appear on the Members page? In the Activity stream?
iow. you need to be more specific about the behaviour that you want.
June 19, 2013 at 7:22 pm #166423In reply to: Hide wp-admin ( WP Dashboard from USers )
Tecca
ParticipantYou can download a plugin like Theme My Login — it automatically redirects logged out/non-registered users to a log-in page with your site’s style.
June 19, 2013 at 6:57 pm #166419In reply to: Hide Buddypress Profile based on Admin Field Value
dpeters
ParticipantAny ideas?
June 15, 2013 at 3:47 pm #166119In reply to: Hide Admin Bar for Logged OUt Users
Liltiger
Participant*My theme also… haha sorry for bad grammar
June 15, 2013 at 3:46 pm #166118In reply to: Hide Admin Bar for Logged OUt Users
Liltiger
ParticipantHey,
If you go to Dashboard Settings > Buddypress > Settings, then the first option is ‘Show the Toolbar for logged out users’. Just uncheck it.
My theme is also has a setting for the login toolbar, so you may want to check out your theme settings.
I hope it helps!
May 29, 2013 at 11:28 am #164980In reply to: hide admin from members list
WPAgentur
ParticipantHi, i put the code in my theme funktions.php but superadmin is still visible in memberslist.
add_action(‘bp_ajax_querystring’,’bpdev_exclude_users’,20,2);
function bpdev_exclude_users($qs=false,$object=false){
//list of users to exclude$excluded_user=’1′;//comma separated ids of users whom you want to exclude
if($object!=’members’)//hide for members only
return $qs;$args=wp_parse_args($qs);
//check if we are searching for friends list etc?, do not exclude in this case
if(!empty($args[‘user_id’])||!empty($args[‘search_terms’]))
return $qs;if(!empty($args[‘exclude’]))
$args[‘exclude’]=$args[‘exclude’].’,’.$excluded_user;
else
$args[‘exclude’]=$excluded_user;$qs=build_query($args);
return $qs;
}
Iam using WP: 3.5.1 and BP: 1.7.2 with the buddyboss-theme.
May 22, 2013 at 3:08 pm #164526In reply to: BuddyPress 1.7.1
Suraj
Participantyou guys are just awesome.
I have a feature request. I searched for the same using Google and almost across all the buddypress related support forum and tried all the codes but the thing is not working for me, I want to hide the admin activities to appear on my site, but it is not working, if possible, can you add a feature to hide all the activity of any particular user if he wants to including his/her online status.May 21, 2013 at 3:45 pm #164444Ben Hansen
Participanti’m not using that one i’m using this one:
<?php //hide superadmin add_action("plugins_loaded","bpdev_init_sm_mode"); function bpdev_init_sm_mode(){ if(is_site_admin()) remove_action("wp_head","bp_core_record_activity"); //id SM is on, remove the record activity hook } ?>May 7, 2013 at 10:44 pm #163561In reply to: Custom User Role Doesn't Have Sufficient Privileges
danzigism
ParticipantYou’re right @shanebp
After reading that manage_options much gives that role access to the entire Settings feature of WordPress I realized that isn’t good. Needless to say, I have used Adminimize to hide the “Settings” tab from the Manager user role for the time being but certain savvy people could still access it if they knew the URL to those settings pages.
I submitted the bug to: https://buddypress.trac.wordpress.org/ticket/4991#ticket
Thanks again for all of your help!
May 3, 2013 at 12:06 pm #163334In reply to: Possible bug – last_activity missing
rypo73
ParticipantOK – you’re onto something… And it seems your initial hunch of PBCK was spot on – feeling foolish, but enlightened now!
SO… I had some code in my custom-functions.php file to ‘hide’ the site admin activity (see below). Because we have several users with ‘Administrator’ roles, it seems this particular user was affected. Others MAY have been if they had logged in more often…
Seems this code was not the best to use:
// Don’t record activity by the site admins or show them as recently active
function my_admin_stealth_mode(){
if ( is_site_admin() ) {
global $bp;
remove_action(‘wp_head’,’bp_core_record_activity’);
delete_user_meta($bp->loggedin_user->id, ‘last_activity’);
}
}
add_action(‘init’,’my_admin_stealth_mode’);SO I’ve removed it in favour of THIS version, specifically masking the activity of INDIVIDUAL users with ‘Administrator’ roles, like our site admin user.
// Don’t record activity for a user or show them as recently active
function my_user_stealth_mode(){
$current_user = wp_get_current_user();
if(is_user_logged_in()) {
if(‘YourUsername’ == $current_user->user_login) {
remove_action(‘wp_head’,’bp_core_record_activity’);
delete_user_meta($current_user->ID, ‘last_activity’);
}
}
}
add_action(‘init’,’my_user_stealth_mode’);Hope it might be of use to others in future. Thanks for responding to my post. I’m now a LOT more familiar with meta data fields as a result.
p.s. you’re right about # plugins, we do need a lot, but not ALL of those. It’s our dev environment after all. Often a case of playing with different ones to see what fits the bill.
April 11, 2013 at 6:59 pm #161330In reply to: Hide Admin Bar Buddypress v. 1.6.1
meg@info
ParticipantIn functions.php file of your current theme 😛
-
AuthorSearch Results