Search Results for 'Hide Admin'
-
Search Results
-
Hi!
How can I hide the BuddyPress “Profile Fields” menu entry (in the WP backend) for non-admin users?
https://pasteboard.co/osvfH8ty1JYk.jpg
They should not be able to make changes there.
Thx in advance and best regards
MarkusHey!
Is there a way to hide Admins from the general member’s directory – maybe with a plugin or a shot script? Also, would that not be a great feature to be included in the next update for BuddyPress?
Thanks in advance
Hi, I want to show the loggedin user profile if he/she tries to access other user’s profile.
Here’s a list of what I want and what I’ve accomplished- OK – Redirect to own profile when entering /members/
- X – Redirect to own profile when entering another profile via link
- OK – WMDs can view member listings
- OK – ADMs can view member profile
This is the code i have until now
function buddydev_hide_members_directory_for_all_except_users_with_specific_roles() { if ( ! bp_is_members_directory() ) { return; } if ( !is_user_logged_in() ) { bp_do_404(); load_template( get_404_template() ); exit( 0 ); } $allowed_roles = array( 'administrator', 'editor' ); $hide = true; $user = wp_get_current_user(); foreach ( $allowed_roles as $role ) { if ( in_array( $role, $user->roles, true ) ) { $hide = false; break; } } if ( ! $hide ) { return; } /** * bp_is_my_profile() * bp_is_user_profile() * bp_is_user() * bbp_is_single_user_profile() * bbp_is_user_home() * bbp_is_single_user() */ if(!bbp_is_user_home()){ wp_redirect(bp_loggedin_user_domain()); } //REDIRECT TO USER PROFILE wp_redirect(bp_loggedin_user_domain()); exit( 0 ); } add_action( 'bp_template_redirect', 'buddydev_hide_members_directory_for_all_except_users_with_specific_roles' );
I tried some things like the last IF with the commented functions but none work, so I guess I’m doing something wrong. Can you help me plz?
Thanks in advance
How can I do this in the current version? Then when they login it is there so they can edit etc their profile.
Hello,
I am looking for php code to be inserted into my custom function plugin so that my admin account will be visible hidden from members on members directory and else where.
I did see some colder codes here but it does not seem to be working on the current BuddyPress version.
Does anyone have the workable code?
Thanks
Topic: “Show password” in login
Hello,
does anybody know if such a tutoral exists also for buddypress?: https://www.champ.ninja/2020/05/show-passwords-feature-in-ultimate-member-forms/
Maybe I was searching for the wrong terms. I have hide/show password with wp-admin.php of course but not for regular members when registering or loggin in, so I would like to add this.
Good Day,
I currently have BuddyPress Create Group Type and BuddyPress installed on my word press website. I use it such a way the administrators of each group do not necessarily have to edit a few of the settings because they are usually less tech savy. I would like to know is it possible to hide some of the settings on the front end in the management window such as settings, delete and forums.Also I would like to know if it is possible to have the email information that is sent to person when they are rejected from a group to be changed? Because we find the you have been rejected message a bit harsh.
Hi,
I want only the admin to have access to the memberslist.
How to achieve that?hi there,
i am looking for a way to hide user role in member page, i still don’t have a working solution. anyone have any ideas, thanks.I tried using this guide:
https://wordpress.org/support/topic/hide-admin-users-from-being-displayed-in-members-directory/ is not working.I want to remove “HOME” in BP
So the result should be first MENU Item is “FORUM” then “MEMBERS” “SEND INVITATIONS” and “ADMIN” (for admins only)As default the menu is :
“HOME” then “FORUM” then “MEMBERS” “SEND INVITATIONS” and “ADMIN” (for admins only)But users that get’s in at the “HOME” level post messages thinking they are posting in the FORUM…? So that is why I want to hide it or take it off!
Hope this solution works – But are unsure where to stick it… 🙂
Best regards
Ehhh any functions.php ?? Themes, BP or in a specific folder?
Hello, I wanted to ask, how can I exclude certain member role from showing on member list and be redirected to “wp-login” when non logged visitors try to access their profile.
-
For first task, I use this code to exclude certain user ID from beeing in member list (but this code need modification to accept certain role and don’t show those member just for non logged visitors)
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');
-
For second task, I use this code but I dont know how to select certain member role{
function nonreg_visitor_redirect() { global $bp; if ( bp_is_user() && !is_super_admin() ) { if(!is_user_logged_in()) { //just a visitor and not logged in wp_redirect( get_option('siteurl') . '/wp-login.php' ); } } } add_filter('get_header','nonreg_visitor_redirect',1);
Hi, i feel like im doing this properly but i never get the right result. i have a custom meta called “featured” in activity meta. For testing purposes the meta values are 1,2,3,4 my goal is to have an activity loop order activities by the meta value. i’ve checked the documentation and i came up with this.
<?php get_header(); ?> <?php get_template_part('page-parts/general-title-section'); ?> <?php get_template_part('page-parts/general-before-wrap'); $atts = array( 'title' => 'Latest Activity',// title of the section. 'pagination' => 1,// show or not. 'load_more' => 0, 'display_comments' => 'threaded', 'include' => false, // pass an activity_id or string of IDs comma-separated 'exclude' => false, // pass an activity_id or string of IDs comma-separated 'in' => false, // comma-separated list or array of activity IDs among which to search 'sort' => 'DESC', // sort DESC or ASC 'page' => 1, // which page to load 'per_page' => 5, // how many per page. 'max' => false, // max number to return. 'count_total' => true, // Scope - pre-built activity filters for a user (friends/groups/favorites/mentions). 'scope' => false, // Filtering 'user_id' => false, // user_id to filter on 'object' => false, // object to filter on e.g. groups, profile, status, friends 'action' => false, // action to filter on e.g. activity_update, new_forum_post, profile_updated 'primary_id' => false, // object ID to filter on e.g. a group_id or forum_id or blog_id etc. 'secondary_id' => false, // secondary object ID to filter on e.g. a post_id. // Searching 'search_terms' => false, // specify terms to search on. 'use_compat' => bp_use_theme_compat_with_current_theme(), 'allow_posting' => false, // experimental, some of the themes may not support it. 'container_class' => 'activity',// default container, 'hide_on_activity' => 1,// hide on user and group activity pages. 'for' => '', // 'logged','displayed','author'. 'role' => '', // use one or more role here(e.g administrator,editor etc). 'for_group' => '',// group slug. ); $atts['meta_query']= array( array( 'key' => 'featured', 'value' => '0', 'type' => 'numeric', 'compare' => '!=', ), 'meta_type' => 'numeric', 'orderby' => 'meta_value_num', 'meta_key' => 'featured', 'order' => 'DESC' ); ?> <div id="buddypress"> <?php do_action( 'bp_before_activity_loop' ); if ( bp_has_activities( $atts ) ) : ?> <div class="<?php echo esc_attr( $atts['container_class'] ); ?> <?php if ( ! $atts['display_comments'] ) : ?> hide-activity-comments<?php endif; ?>"> <ul id="activity-stream" class="activity-list item-list"> <?php while ( bp_activities() ) : bp_the_activity(); ?> <?php bp_get_template_part( 'buddypress/activity/entry' ); ?> <?php endwhile; ?> <?php if ( $atts['load_more'] && bp_activity_has_more_items() ) : ?> <li class="load-more"> <a href="<?php bp_activity_load_more_link() ?>"><?php _e( 'Load More', 'buddypress' ); ?></a> </li> <?php endif; ?> </ul> <?php if ( $atts['pagination'] && ! $atts['load_more'] ) : ?> <div class="pagination"> <div class="pag-count"><?php bp_activity_pagination_count(); ?></div> <div class="pagination-links"><?php bp_activity_pagination_links(); ?></div> </div> <?php endif; ?> </div> <?php else : ?> <div id="message" class="info"> <p><?php _e( 'Sorry, there was no activity found. Please try a different filter.', 'buddypress' ); ?></p> </div> <?php endif; ?> ?> </div> <?php do_action( 'bp_after_activity_loop' ); ?> <?php get_template_part('page-parts/general-after-wrap'); ?> <?php get_footer(); ?>
everything here works except for the order. for some reason it always orders by activity ID. am i missing something here? Thanks in advance im going crazy with this.
Topic: Hide Admin(s) from Bp Widget
How to hide the admin profile in the section (recently active?)
Topic: Hiding Toolbar for members
Hi,
how can i hide the wordpress toolbar (adminbar) for logged in (!) buddypress members?
thanks!
How do I remove/hide the “View Admins” button from groups page?
Hi there,
I would like to hide the admin bar for users, but I still want them to be able to edit and update their profile. Therefore, I need a link in the front end to the profile edit screen.
Can you please help me achieve this?
Thanks.