Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'Hide Admin'

Viewing 25 results - 26 through 50 (of 670 total)
  • Author
    Search Results
  • #323623
    ayllachristinne
    Participant

    Thats the code:
    function buddydev_hide_members() {
    $allowed_roles = array( ‘administrator’, ‘editor’ );
    $hide = true;
    $user = wp_get_current_user();

    if(str_contains($_SERVER[‘REQUEST_URI’], ‘/membros/’)){
    //REDIRECIONA PARA LOGIN SE NÃO ESTIVER LOGADO
    if ( !is_user_logged_in() ) {
    wp_safe_redirect(get_permalink(get_page_by_path(‘login-registro’)));
    exit;
    }

    //CHECANDO SE TEM O PAPEL QUE PODE VISUALIZAR
    foreach ( $allowed_roles as $role ) {
    if ( in_array( $role, $user->roles, true ) ) {
    $hide = false;
    break;
    }
    }

    if( ! $hide ){
    return;
    } elseif(!bbp_is_user_home()) {
    wp_safe_redirect(bp_loggedin_user_domain());
    exit;
    }
    }
    }
    add_action( ‘bp_template_redirect’, ‘buddydev_hide_members’);

    ayllachristinne
    Participant

    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

    #322843
    atfpodcast
    Participant

    How can I do this in the current version? Then when they login it is there so they can edit etc their profile.

    deaf25
    Participant

    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

    #319766
    veshop
    Participant

    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.

    #319470
    nathan767
    Participant

    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.

    #319278
    gringanc
    Participant

    Dumb question, but is bbpress the same thing as buddypress? Will the bbp shortcodes work on Buddypress? Without a plugin? We have seen other references that [bc-…] are shortcodes for BuddyPress, where as [bbp-…] is for BBpress.

    Use case: We’re trying to have our own login page and hide the WordPress bar for non-admin users. The login does not need to be a WordPress.com login for our purposes.

    eddypiv
    Participant

    Hi,

    I want only the admin to have access to the memberslist.
    How to achieve that?

    juliamb
    Participant

    Hi!

    I’ve created a custom role that can edit groups, so it has the ‘manage_options’ capability assigned.
    Now I’m trying to hide the option Tools > BuddyPress from the administration menu for this role. I was following this tutorial but I cannot find the way to address that specific page.
    I’m using this code but it’s not working:

    remove_menu_page('bp-tools');

    The page URL is different from administrator role to the others.

    • URL for Administrators: /wp-admin/tools.php?page=bp-tools
    • URL for other roles: /wp-admin/export-personal-data.php?page=bp-tools

    How can I hide this menu option?

    Thanks, regards.

    #318912
    khocvole1197
    Participant

    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.

    emptypack
    Participant

    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);
    petertucker
    Participant

    Here is the solution for anyone who is going to see this post in the future.

    1. Install the username change plugin:
    https://buddydev.com/plugins/bp-username-changer/
    2. Add to the plugins code (bp-change-username.php) on line 163;

    
    xprofile_set_field_data(1, $user_id,  $new_user_name);
    

    3. In your theme function.php file add the follow code to hide XProfile editing:

    
    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 groups, separated by comma
                    //$retval['exclude_groups'] = '1';
            } 
            return $retval;         
    
            endif;
    }
    add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_field_group' );
    

    I hope this helps anyone who finds it.

    #316135
    haitianguy
    Participant

    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.

    rando
    Participant

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

    i want a redirect code to a url
    &
    i want a code for echo a message without redirecting

    thanks

    #313798
    Achille
    Participant

    How to hide the admin profile in the section (recently active?)

    http://prntscr.com/ugge3r

    #313544
    amtenbrink
    Participant

    Hi,

    how can i hide the wordpress toolbar (adminbar) for logged in (!) buddypress members?

    thanks!

    #312915
    songdove
    Participant

    Update, I found a way to change the literal username, but if you’re admin, I don’t recommend it particularly if you are admin of a multi-site setup as I am. I had to change my username back to get to the multi-site administration area. Either way, the change did not hide the login name, it only changed it. Not the solution any of us are after.

    bluesweet
    Participant

    How do I remove/hide the “View Admins” button from groups page?

    #311661
    pierremaitre
    Participant

    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.

    #310816

    In reply to: /Members’ slug

    globsticks
    Participant

    it worked!

    Hi Brajesh,

    My website does have a registration page, so users have to click on the logout link at some point.
    I am hiding the admin page via secret Login Slug, but I noticed that users can read its value from the URL when they log out. ¿do you happen to know how to I hide the Login Slug from logout URL please?

    !Thank you!

    Hide Login Slug value on Logout

    #310423
    vinem
    Participant

    Hi there,

    I’ve seen a lot of people asking this but no one provided a good solution to do so.
    So, is there a way to hide the admin profile from other members ?
    I don’t want my activities to appear in the stream or people to have access to my admin profile.

    I tried a bunch of plugins and code lines I found through Google but nothing worked.

    Thank you!

    #310282
    stephenss
    Participant

    Hi Everyone,

    Need your help.

    How do I hide Admins from the search Members list on the frontend using BuddyPress?

    Regards
    Stephen

    #309830
    bmcconach
    Participant

    Howdy, BuddyPress friends!

    I have been working on a project for fun and have been enjoying the laying out of items and adding plugin functionality a bit much here lately. So much so, in fact, that I put the testing phase on the back shelf for a bit.

    When I was attempting to request membership from a test account to a private group that my admin account was the creator of, I ran into an issue: I can get to the request page (/groups/test-group/request-membership/?_wpnonce=47febc75fe) by clicking the link to do so and then am presented with a textarea for request comments, however when I submit the form (with or without comments) I am taken back to the group’s main page (/groups/test-group/) and am presented with “There was an error sending your group membership request. Please try again.” The request does not come through (not in BP’s notifications, e-mail, pending requests, etc.) at all.

    At first this was a minor irritation because I could go to the group as the admin and invite the test account to join the group. There I am presented with a checkbox for my test account’s name, as well as a submit button; however when clicking on the checkbox, the form instantly submits without ever sending an invite. I even attempted to modify the live source to set the field to checked, attempted to submit, and received a success message stating my invite was sent, but of course it never was.

    I have checked the list of plugins I have on my site, disabled a few I didn’t necessarily need, and have checked each of the remaining to see if there’s any sort of conflict between plugins affecting groups, but to no avail. This functionality is key to the use of groups for my project, so I would sincerely appreciate any advice from more knowledgeable members of the BP community.

    Some support information, including a list of active plugins, can be found below. Please note that any plugin with ** beside it came bundled with the theme.

    == Server Environment ==
    	Operating System: Linux
    	Software: Apache/2.4.6
    	MySQL version: MariaDB Server v5.5.61-MariaDB-38.13
    	PHP Version: 7.2.24
    	PHP Max Input Vars: 2500
    	PHP Max Post Size: 64M
    	GD Installed: Yes
    	ZIP Installed: Yes
    	Write Permissions: All right
    	Elementor Library: Connected
    
    == WordPress Environment ==
    	Version: 5.3.2
    	WP Multisite: No
    	Max Upload Size: 64 MB
    	Memory limit: 512M
    	Permalink Structure: /%postname%/
    	Language: en-US
    	Timezone: America/New_York
    	Debug Mode: Inactive
    
    == Theme ==
    	Name: Gwangi
    	Version: 2.1.1
    	Author: Themosaurus
    	Child Theme: No
    
    == User ==
    	Role: administrator
    	WP Profile lang: en_US
    	User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36
    
    == Active Plugins ==
    	(BuddyDev) BP Auto Login on Activation
    		Version: 1.0.3
    		Author: Brajesh Singh
    
    	Author Avatars List**
    		Version: 1.18
    		Author: Paul Bearne
    
    	Awesome Weather Widget
    		Version: 3.0.2
    		Author: Hal Gatewood
    
    	bbPress
    		Version: 2.6.3
    		Author: The bbPress Contributors
    
    	BP Messages Tool
    		Version: 2.1
    		Author: PhiloPress
    
    	BP Profile Search
    		Version: 5.2.4
    		Author: Andrea Tarantini
    
    	BuddyPress
    		Version: 5.1.2
    		Author: The BuddyPress Community
    
    	BuddyPress Default Cover Photo
    		Version: 1.6.0
    		Author: SeventhQueen
    
    	BuddyPress Extended Friendship Request
    		Version: 1.2.0
    		Author: BuddyDev Team
    
    	BuddyPress Reorder Tabs
    		Version: 2.0.1
    		Author: BuddyBoss
    
    	BuddyPress Xprofile Custom Field Types
    		Version: 1.1.3
    		Author: BuddyDev
    
    	Classic Editor
    		Version: 1.5
    		Author: WordPress Contributors
    
    	Classic Editor Addon
    		Version: 2.6.0
    		Author: Pieter Bos, Greg Schoppe
    
    	Dashboard Notepad
    		Version: 1.42
    		Author: Stephanie Leary
    
    	Easy Custom Sidebars**
    		Version: 1.0.10
    		Author: Titanium Themes
    
    	Elementor**
    		Version: 2.8.3
    		Author: Elementor.com
    
    	Envato Market
    		Version: 2.0.3
    		Author: Envato
    
    	Essential Addons for Elementor
    		Version: 3.7.1
    		Author: WPDeveloper
    
    	Grimlock**
    		Version: 1.2.5
    		Author: Themosaurus
    
    	Grimlock Animate**
    		Version: 1.1.0
    		Author: Themosaurus
    
    	Grimlock for Author Avatars List**
    		Version: 1.0.4
    		Author: Themosaurus
    
    	Grimlock for bbPress**
    		Version: 1.0.3
    		Author: Themosaurus
    
    	Grimlock for BuddyPress**
    		Version: 1.1.4
    		Author: Themosaurus
    
    	Grimlock for Elementor**
    		Version: 1.0.1
    		Author: Themosaurus
    
    	Grimlock for Jetpack**
    		Version: 1.0.4
    		Author: Themosaurus
    
    	Grimlock for Testimonials by WooThemes**
    		Version: 1.1.0
    		Author: Themosaurus
    
    	Grimlock for The Events Calendar**
    		Version: 1.1.2
    		Author: Themosaurus
    
    	Grimlock Hero**
    		Version: 1.0.7
    		Author: Themosaurus
    
    	Grimlock Isotope**
    		Version: 1.0.7
    		Author: Themosaurus
    
    	Grimlock Login**
    		Version: 1.0.10
    		Author: Themosaurus
    
    	Hide Admin Bar
    		Version: 0.3.9.9
    		Author: Shelby DeNike
    
    	If Menu - Visibility control for menu items
    		Version: 0.15
    		Author: Layered
    
    	Kirki Customizer Framework**
    		Version: 3.0.45
    		Author: Ari Stathopoulos
    
    	MediaPress
    		Version: 1.4.6
    		Author: BuddyDev
    
    	Menu Image**
    		Version: 2.9.5
    		Author: Rui Guerreiro
    
    	Simple Buddypress Profile Privacy
    		Version: 0.7.9
    		Author: Justin Hansen
    
    	Social Articles
    		Version: 2.9.5
    		Author: Broobe
    
    	The Events Calendar
    		Version: 4.9.14
    		Author: Modern Tribe, Inc.
    
    	UpdraftPlus - Backup/Restore
    		Version: 1.16.21
    		Author: UpdraftPlus.Com, DavidAnderson
    
    	Verified Member for BuddyPress**
    		Version: 1.1.1
    		Author: Themosaurus
    
    == Must-Use Plugins ==
    	Gateway Relay
    		Version: 1.0
    		Author: Arnold Bailey (Incsub)
    
    	rms_unique_wp_mu_pl_fl_nm.php
    		Version: 
    		Author: 
    
    	WPMU Assist
    		Version: 1.0.2
    		Author: Arnold Bailey (Incsub)
    
    == Elements Usage ==
    	
    	wp-page : 12
    		eael-adv-tabs : 1
    		google_maps : 1
    		image-carousel : 1
    		shortcode : 1
    		text-editor : 1
    		wp-widget-grimlock_author_avatars_section_widget : 1
    		wp-widget-grimlock_posts_section_widget : 1
    		wp-widget-grimlock_query_section_widget : 1
    		wp-widget-grimlock_section_widget : 3
    		wp-widget-grimlock_the_events_calendar_tribe_events_section_widget : 1
    
    == Log ==
    	
    PHP: showing 1 of 1PHP: 2020-01-02 10:43:38 [error X 1][/home/*****/public_html/wp-content/plugins/elementor/elementor.php::97] Cannot redeclare elementor_fail_wp_version() (previously declared in /home/*****/public_html/wp-content/plugins/elementor/elementor.php:97) [array (
      'trace' => '
    #0: Elementor\Core\Logger\Manager -> shutdown()
    ',
    )]
    
    JS: showing 1 of 1JS: 2020-01-11 16:50:05 [error X 1][https://*****/wp-content/plugins/grimlock/assets/js/navigation-stick-to-top.js?ver=1.2.5:27:45] Cannot read property \'top\' of undefined
    #307760
    beat sk
    Participant

    Hello,

    I have a question about buddypress profile menu. How can i make a link in the menu only for userroles? Something like “Go to administration” in the profile menu – Profile, Activity, Groups, Messages ? Is there a chance to add this only for user roles and admins? Register and Login working on front-end and we want hide /wp-admin from others. Thank you.

    #306977
    beat sk
    Participant

    Hello,

    I have a question about buddypress profile menu. How can i make a link in the menu only for userroles? Something like “Go to administration” in the profile menu – Profile, Activity, Groups, Messages ? Is there a chance to add this only for user roles and admins? Register and Login working on front-end and we want hide /wp-admin from others. Thank you for positive/negative feedback.

Viewing 25 results - 26 through 50 (of 670 total)
Skip to toolbar