Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'Hide Admin'

Viewing 25 results - 201 through 225 (of 691 total)
  • Author
    Search Results
  • #258234
    Fantacular Designs
    Participant

    I also attempted to add them individually…

    function bpfr_hide_tabs() {
    global $bp;
    
    	if ( bp_is_user() && !is_super_admin() ) {
    		bp_core_remove_nav_item( 'activity' );
    		bp_core_remove_nav_item( 'notifications' );
    		bp_core_remove_nav_item( 'messages' );
    		bp_core_remove_nav_item( 'groups' );
    		bp_core_remove_nav_item( 'forums' );
    		bp_core_remove_nav_item( 'settings' );
    	}
    	
    }
    add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );
    

    I’ve noticed some changes require us to repeat ourselves, while others allow us to list changes within one line of code. Haven’t deciphered this anomaly just yet.

    #258232
    Fantacular Designs
    Participant

    I placed the following code in the bp-custom.php which was found under the wp-content -> plugins.

    function bpfr_hide_tabs() {
    global $bp;
    
    	if ( bp_is_user() && !is_super_admin() ) {
    		bp_core_remove_nav_item( 'notifications', 'activity', 'groups', 'messages', 'forums', 'settings');
    	}
    	
    }
    add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );
    

    It breaks my site, shuts it down. From what I’ve read, I am supposed to specify what tab is open when opening a profile. Otherwise, browsers don’t know what to display since default is “Activity” and I’m removing it… Can someone please tell me where I went wrong? I appreciate the help!

    #258209
    danbp
    Participant

    Hi,

    bp’s Usermenu is added to wp_admin_menu on the Toolbar, under Howdy. This BP menu ID is “my-account”.

    When you’re on a profile page, you see also these items in the Buddymenu, below the profile header cover.

    Some working examples here:
    Remove an item from Usermenu

    Remove an item from Buddymenu

    Since 2.6, BuddyPress use a navigation API. See here for many use case.

    Read also WP codex about admin bar menus.

    Where to put BuddyPress custom code ?
    Usually into bp-custom.php. This file is to BP code what a child theme is to a theme: a safe place with high priority where nothing get to loose when an update occurs !

    Child’s functions.php should be reserved to whatever you need for the theme itself.
    That said, it can happen(rarely) that some custom code won’t work from within bp-custom. In this case, feel free to remove it from bp-custom and give it a try inside child’s functions.php.

    As novice, you’re invited to read BP and WP codex if you want to customize.

    #258103

    In reply to: New Privacy Plugin

    danbp
    Participant

    The whole idea is that the profile is locked down completely so I don’t want the viewer to see the activity or any other part unless they fit the criteria laid out by the member.

    I understand that. But as the member appears on SWA and directories, you have to go deeper into BP and hide his activities, remove it from directories and so on. Or as already said, give this as “ultimate” option, with a big warning to site admins – and to the user. Something like: if you choose this option, your whole profile (activity, friends and group membership list) will be hidden to all members and visitors.

    It was initially for a client of yours, ok, but that’s a specific use case. I would better leave that possible from inside the plugin code only (ie. a filter that a dev could activate) and give a smoother option for common community usage to the majority of BP users.

    #257452
    mrjarbenne
    Participant

    You could completely customize the Admin-bar. This snippet should help, put in either the functions.php file of your theme, or in the bp-custom.php file. It should give you a good idea of what is possible. I’m hiding the W menu. You could probably hide the Site dropdown altogether and then craft your own dropdown with links to different items. Particularly if this is a single install of BP, and not a Network/Multisite install, there really isn’t any reason for your users to see the Site dropdown:

    	/**
    	 * Adds custom "Home" menu to WP Adminbar.
    	 *
    	 * Also removes the "WP logo" menu.
    	 *
    	 * @param object $wp_admin_bar The WP Admin Bar object
    	 */
    	public function add_custom_parent_menu( $wp_admin_bar ) {
    
    		/**
    		 * Removing the "W" menu
    		 */
    		$wp_admin_bar->remove_menu( 'wp-logo' );
    
    		/**
    		 * Create a "Home" menu.
    		 *
    		 * First, just create the parent menu item.
    		 */
    		$wp_admin_bar->add_menu( array(
    			'id' => 'commonlinks',
    			'parent' => '0', //puts it on the left-hand side
    			'title' => 'Home',
    			'href' => ('http://domain.com/activity')
    		) );
    
    		/**
    		 * Add submenu items to "Home" menu.
    		 */
    		// Only show the following for logged-in users
    		if ( current_user_can( 'read' ) ) {
    			// Support link
    			$wp_admin_bar->add_menu( array(
    				'id' => 'support',
    				'parent' => 'commonlinks',
    				'title' => 'Support',
    				'href' => ('http://domain.com/support')
    			) );
    
    			// Blog request form
    			$wp_admin_bar->add_menu( array(
    				'id' => 'blogrequest',
    				'parent' => 'commonlinks',
    				'title' => 'Feedback',
    				'href' => ('http://domain.com/feedback' )
    			) );
    
    			// Developers blog
    			$wp_admin_bar->add_menu( array(
    				'id' => 'developments',
    				'parent' => 'commonlinks',
    				'title' => 'Developments',
    				'href' => ('http://domain.com/developments' )
    			) );
    
    		}
    
    	}
    #257724

    Thank you Henry, but we already tried this hook.

    Maybe I should give you some code:

    
    class SKS_Test {
    	public function __construct() {
    		add_action( 'activated_plugin', array( $this, 'activated_plugin' ), 99, 1 );
    	}
    
    	public function activated_plugin( $plugin ) {
    
    		if ( $plugin == 'buddypress/bp-loader.php' && ! get_option( 'sks_installed', false ) ) {
    			$bp_active_components = get_option( 'bp-active-components', array() );
    			$bp_active_components['groups'] = 1;
    
    			delete_transient( '_bp_is_new_install' );
    			delete_transient( '_bp_activation_redirect' );
    
    			update_option( 'bp-active-components', $bp_active_components );
    			update_option( 'hide-loggedout-adminbar', 1 );
    		}
    	}
    }
    

    The group component is still disabled in the settings of BuddyPress 🙁

    #257573
    NormadSoul
    Participant

    I’m going to do more with your admin groups .

    For example

    The box administrator with limited opportunities can base your group and take their users, and manage them . But it can not manage other groups.

    Then the administrator and his group can hide posts or publish .

    Group administrator can grant up to the author ’s website , but can not modify pages of other groups ?

    Possible?

    Thank you

    #257453
    mrjarbenne
    Participant

    You could customize the adminbar completely, using this snippet. I’m hiding the W menu, but you could probably hid the Sites menu and then add your own dropdown with the requisite links.

    http://www.wpbeginner.com/plugins/how-to-add-edit-re-order-or-hide-wordpress-admin-menus/

             /**
    	 * Adds custom "Home" menu to WP Adminbar.
    	 *
    	 * Also removes the "WP logo" menu.
    	 *
    	 * @param object $wp_admin_bar The WP Admin Bar object
    	 */
    	public function add_custom_parent_menu( $wp_admin_bar ) {
    
    		/**
    		 * Removing the "W" menu
    		 */
    		$wp_admin_bar->remove_menu( 'wp-logo' );
    
    		/**
    		 * Create a "Home" menu.
    		 *
    		 * First, just create the parent menu item.
    		 */
    		$wp_admin_bar->add_menu( array(
    			'id' => 'commonlinks',
    			'parent' => '0', //puts it on the left-hand side
    			'title' => 'Home',
    			'href' => ('INSERT LINK HERE')
    		) );
    
    		/**
    		 * Add submenu items to "Home" menu.
    		 */
    		// Only show the following for logged-in users
    		if ( current_user_can( 'read' ) ) {
    			// Support link
    			$wp_admin_bar->add_menu( array(
    				'id' => 'support',
    				'parent' => 'commonlinks',
    				'title' => 'Support',
    				'href' => ('INSERT LINK HERE')
    			) );
    
    			// Blog request form
    			$wp_admin_bar->add_menu( array(
    				'id' => 'blogrequest',
    				'parent' => 'commonlinks',
    				'title' => 'Stuff',
    				'href' => ('INSERT LINK HERE' )
    			) );
    
    			// Developers blog
    			$wp_admin_bar->add_menu( array(
    				'id' => 'developments',
    				'parent' => 'commonlinks',
    				'title' => 'Developments',
    				'href' => ('INSERT LINK HERE' )
    			) );
    
    		}
    
    	}
    #257327
    danbp
    Participant

    Hi,

    two snippets to remove profile and group items.

    function bpex_hide_profile_menu_tabs() {
    
    	if( bp_is_active( 'xprofile' ) ) :
    
    	if ( bp_is_user() && !is_super_admin() && !bp_is_my_profile() ) {
    	//	BP's profile main menu items. Comment those to show.
    	//	bp_core_remove_nav_item( 'activity' );
    		bp_core_remove_nav_item( 'profile' );
    		bp_core_remove_nav_item( 'friends' );
    		bp_core_remove_nav_item( 'groups' );
    	//	exist only if you use bbPress
    		bp_core_remove_nav_item( 'forums' ); 
    
    	//	BP's profile main menu items. Comment those to show.
    	//	bp_core_remove_subnav_item( 'activity', 'personnal' );
    		bp_core_remove_subnav_item( 'activity', 'mentions' );
    		bp_core_remove_subnav_item( 'activity', 'favorites' );
    		bp_core_remove_subnav_item( 'activity', 'friends' );
    		bp_core_remove_subnav_item( 'activity', 'groups' );
    	}
    	endif; 
    }
    add_action( 'bp_setup_nav', 'bpex_hide_profile_menu_tabs', 15 );
    
    function bpex_remove_group_tabs() {  
    
    	if ( ! bp_is_group() ) {
    		return;
    	}
    
    	$slug = bp_get_current_group_slug();
    
    		// hide items to all users except site admin
    	if ( !is_super_admin() ) {
    
    	//	bp_core_remove_subnav_item( $slug, 'members' );
    		bp_core_remove_subnav_item( $slug, 'send-invites' );
    	//	bp_core_remove_subnav_item( $slug, 'admin' );
    	//	bp_core_remove_subnav_item( $slug, 'forum' );
    	}
    
    }
    add_action( 'bp_actions', 'bpex_remove_group_tabs' );
    fidelduque
    Participant

    Hi, I’m using Buddypress Version 2.5.3 and WordPress 4.5.2.

    I’m running a multisite wordpress installation, Right now I’m trying to exclude the suscribers in the members directory, this is the code i found:

    function bpdev_exclude_users($qs=false,$object=false){
        //list of users to exclude
         
        if($object!='members')//hide for members only
            return $qs;
            
        $excluded_user = implode(',',get_users('role=subscriber&fields=ID'));
        $excluded_admins = implode(',',get_users('role=administrator&fields=ID'));
        //$excluded_self=bp_loggedin_user_id();
    	
        
        $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']))
            return $qs;
        
        if(!empty($args['exclude'])){		
            $args['exclude']=$args['exclude'].','.$excluded_user;
            $args['exclude']=$args['exclude'].','.$excluded_admins;
            //$args['exclude']=$args['exclude'].','.$excluded_self;
        } else {
            $args['exclude']=$excluded_user;		
    		if(!empty($args['exclude']))
    			$args['exclude']= $args['exclude'].','.$excluded_admins;
    		else
    			$args['exclude']=$excluded_admins;
            //$args['exclude']=$excluded_self;
        }
        $qs=build_query($args);
       
       return $qs;  
    }
    add_action('bp_ajax_querystring','bpdev_exclude_users',20,2);

    but right now, the get_users function won’t show any subscriber because there are not suscribers on this site, but on the other ones. Anyway, the buddypress is showing all users including the ones in the other sites.

    any hint?

    Thanks

    #256419
    danbp
    Participant

    It’s the same principle, but not the same syntax since 2.6

    To hide tabs on groups, you need to specify the component. Note that all menu items (nav and subnav items) are considered as sub-nav, they have not the same distinction as on member or activity menus.

    Use another function for groups. Try this.

    function bpex_remove_group_tabs() {  
    
    	if ( ! bp_is_group() ) {
    		return;
    	}
    
    	$slug = bp_get_current_group_slug();
    
    		// hide items to all users except site admin
    	if ( !is_super_admin() ) {
    
    	//	bp_core_remove_subnav_item( $slug, 'members' );
    		bp_core_remove_subnav_item( $slug, 'send-invites' );
    	//	bp_core_remove_subnav_item( $slug, 'admin' );
    	//	bp_core_remove_subnav_item( $slug, 'forum' );
    	}
    
    }
    add_action( 'bp_actions', 'bpex_remove_group_tabs' );

    To get more usage examples, see here:

    Navigation API

    #256411
    danbp
    Participant

    Add this snippet to bp-custom.php and give it a try.

    function bpex_hide_profile_menu_tabs() {
    
    	if( bp_is_active( 'xprofile' ) ) :
    
    	if ( bp_is_user() && !is_super_admin() && !bp_is_my_profile() ) {
    	//	BP's profile main menu items. Comment those to show.
    	//	bp_core_remove_nav_item( 'activity' );
    		bp_core_remove_nav_item( 'profile' );
    		bp_core_remove_nav_item( 'friends' );
    		bp_core_remove_nav_item( 'groups' );
    	//	exist only if you use bbPress
    		bp_core_remove_nav_item( 'forums' ); 
    
    	//	BP's profile main menu items. Comment those to show.
    	//	bp_core_remove_subnav_item( 'activity', 'personnal' );
    		bp_core_remove_subnav_item( 'activity', 'mentions' );
    		bp_core_remove_subnav_item( 'activity', 'favorites' );
    		bp_core_remove_subnav_item( 'activity', 'friends' );
    		bp_core_remove_subnav_item( 'activity', 'groups' );
    	}
    	endif;
    }
    add_action( 'bp_setup_nav', 'bpex_hide_profile_menu_tabs', 15 );
    #255641
    allisonnance
    Participant

    I’ve been searching and trying many possible solutions for this but still haven’t found anything that works for me. Admins are showing up in the group member list. I need to hide them in the list but still allow their activity to show in the activity stream.

    I found the parameter exclude_admins_mods in the bp-groups-functions.php and it’s set to true but admins are still showing. I’m not experience with php so this is a trial and error thing.

    #255613
    siparker
    Participant

    For anyone who is looking for the solution for not being able to save buddypress settings.

    Various plugins cause issues with adding various extra css in the admin area.

    in my case there was a css file from a Codecanyon Woozone plugin which hid the P tags in the buddypress options pages

    use firebug and find the bottom div that cotnains the submit button and disable any css that is hiding it and you can click the submit button.

    after you have done that you might want to tell the plugin developer that caused the issue about it.

    TLDR the button is there its probably just hidden. use firebug or chrome tools to unhide it and click save.

    navyspitfire
    Participant

    Hi Dan, thank you for your snippet. My issue was that I was trying to hide subscribers, admins, and the current user in the same function; separating subscribers/admins and current user into two different functions did the trick.

    danbp
    Participant

    Hi @navyspitfire,

    when you pick up code somewhere, you should also read the comments. The solution to your issue was in one of them.

    Here is what wil exclude site admin from members directory and exclude also the logged_in user. The total member count will also be adjusted correctly on All members [x] tab and for the pagination count. $count-2 instead of $count-1 do the trick.

    Excluded members, incl. admin, are of course excluded from search.

    function bpex_hide_admin_on_member_directory( $qs=false, $object=false ){
    
    	// Id's to hide, separated by comma
    	$excluded_user = '1' ;
    
    	// hide to members & friends 
    	if($object != 'members' && $object != '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','bpex_hide_admin_on_member_directory', 20, 2 );
    
    // once admin is excluded, we must recount the members !
    function bpex_hide_get_total_filter( $count ){
    	return $count-2;
    }
    add_filter( 'bp_get_total_member_count', 'bpex_hide_get_total_filter' );
    
    function bpex_exclude_loggedin_user( $qs = false, $object = false ) {
    
     //list of users to exclude
     if( !is_user_logged_in() )
         return $qs;
    
     //if the user is logged in , let us exclude her/him
     $excluded_user=  get_current_user_id();
      
     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;
      
    }
    add_action('bp_ajax_querystring','bpex_exclude_loggedin_user', 20, 2 );

    Codex Reference

    Playing with the user’s ID in different contexts

    #255452
    danbp
    Participant

    @gerwinb, use this snippet for 2.6 +. Corrected, tested and approved by @imath

    function gwb_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(
    		'group-avatar' => 1,
    		'delete-group' => 1,
    	);
    	$parent_nav_slug = bp_get_current_group_slug() . '_manage';
    	// Remove the nav items
    	foreach ( array_keys( $hide_tabs ) as $tab ) {
    	  // Since 2.6, You just need to add the 'groups' parameter at the end of the bp_core_remove_subnav_item
    		bp_core_remove_subnav_item( $parent_nav_slug, $tab, 'groups' );
    	}
    	// You may want to be sure the user can't access
    	if ( ! empty( $hide_tabs[ bp_action_variable( 0 ) ] ) ) {
    		bp_core_add_message( 'Sorry buddy, but this part is restricted to super admins!', 'error' );
    		bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) );
    	}
    }
    add_action( 'bp_actions', 'gwb_remove_group_admin_tab', 9 );
    #255243
    sharmavishal
    Participant

    1. In BuddyPress, we by default get to see member page. I want to know how to redirect someone who is logging in/ new user after registration to News feed?

    search for login redirect plugins for buddypress

    2. I want to keep those wall, timeline and all in menu bar instead of profile tab. How to do that?

    check wp admin bar codex or associated plugins

    3. I am unable to hide admin bar/ that WordPress logo bar for non-admin user. no plugin helping me out.

    am aware of atleast 2 plugins which are working for me. u need to test/check which ones work with ur theme/setup

    4. how to make the menu such that signed in user can see log out button and other sign in/ register?

    via buddypress components in the menus. logged in and logged out menu links

    5. how to enable realtime notification and instant messaging private n groups both?

    notification is already there and its real time. i belive there is a group chat plugin for buddypress as well

    6. how to remove show dropdown menu in profile

    that would depend on ur theme which u are using

    PS:- I don’t know PHP much. moreover, I cannot afford to hire someone.

    then this would take much time and effort to customise it as per ur needs

    start from here

    Configure BuddyPress

    #255238
    kunaldas1997
    Participant

    hello there!

    I am new to BuddyPress.
    1. In BuddyPress, we by default get to see member page. I want to know how to redirect someone who is logging in/ new user after registration to News feed?
    2. I want to keep those wall, timeline and all in menu bar instead of profile tab. How to do that?
    3. I am unable to hide admin bar/ that WordPress logo bar for non-admin user. no plugin helping me out.
    4. how to make the menu such that signed in user can see log out button and other sign in/ register?
    5. how to enable realtime notification and instant messaging private n groups both?
    6. how to remove show dropdown menu in profile
    PS:- I don’t know PHP much. moreover, I cannot afford to hire someone.

    Masoud
    Participant

    @shanebp
    hi. tnx for answer and patience. got 5 more minutes? 🙂
    i read and worked on what you said. and if i want to be honest, i could’t do anything special unfortunately.
    now, i want to ask your opinion about this idea:
    i’ve come up with the idea of hiding that field. (not email field), how?
    with the use of if condition… (if it’s not empty show it. if it has data, hide it)!
    ——-
    i’ve created a custom-meta with this code in theme functions:

    add_action( 'personal_options_update', 'my_save_extra_profile_fields' );
    add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );
    function my_save_extra_profile_fields( $user_id ) {
    if ( !current_user_can( 'edit_user', $user_id ) )
    	return false;
    /* Copy and paste this line for additional fields. */
    add_user_meta( $user_id, ‘person_relation’, 30318 );
    update_usermeta( absint( $user_id ), 'person_relation', wp_kses_post( $_POST['person_relation'] ) );
    update_user_meta( $user_id, 'person_relation', $_POST['person_relation'] );
    }

    and used it in my buddypress signup form, to get data from users. ok?
    after what you said, i went to edit.php (copy to my theme buddypress folder…)
    and added these codes. but it seems that they do not recieve/send data at all.
    it looks like they are empty!! 😐
    after <?php at the start,
    i added :

    global $user, $user_id;
    $person_relation = get_the_author_meta( 'person_relation', $user->ID );
    $user_id = get_current_user_id();

    and in the <form> ,
    i added this piece of code (not working)
    then copied and changed the “save changes button”.
    so there is 2 buttons. one is for my-custom-meta, and the other is for buddypress form.
    buddypress edit page
    if user writes the name and click save. the box/button, all should gone. and i have to see the data in Users admin panel.
    but nothing is getting save… and i dont know where am i doing it wrong

    <?php if( $person_relation == '' ): ?>
    <tr>
    <th><label for="person_relation">Invitor's Name</label></th>
    <td>
    <input type="text" name="person_relation" id="person_relation" value="<?php update_usermeta( $user_id, 'person_relation', $_POST['person_relation'] ); ?>" class="regular-text" /><br />
    <span class="description">Please enter your invitor's name.</span>
    </td>
    </tr>
    <input type="hidden" id="userID" value="<?php echo $user_id ?>"/>
    <div class="submit">
    <input type="submit" name="profile-group-edit-submit" id="profile-group-edit-submit" value="<?php esc_attr_e( 'Save Name', 'buddypress' ); ?> " />
    </div>
    <input type="hidden" name="person_relation" id="person_relation" value="<?php update_usermeta( $user_id, 'person_relation', $_POST['person_relation'] ); ?>" />
    <?php add_action( 'personal_options_update', 'my_save_extra_profile_fields' ); ?>
    <?php add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' ); ?>
    <?php do_action( 'xprofile_profile_field_data_updated'); ?>
    <?php endif; ?>

    so sorry for long description. tnx for help.
    any suggestions do you have?

    danbp
    Participant

    @masoud1111,

    thank you for your appreciation. And sorry for my confusion about setting > general. That’s traditionnally the path used on admin dashboard. In regard of the picture, it’s the mandatory wp registration email field. This part is on your-site/members/USERNAME/settings.

    The template file you can modify is members/single/settings/general.php
    In that file is a form who contains a label and a input type for “email”. To hide, you could add a conditionnal for admin’s only.

    For example, before both label and input lines, add

    <?php if(is_super_admin() ): ?>
       <label>bla
       <input>bla
    <?php endif; ?>

    To be complete, you may want to show message to explain about the email field. In that case, add something like following above:

    
    <?php if ( !is_super_admin() ) : ?>
    <p>Ask site admin if you want to change your email address.</p>
    <?php endif; ?>
    Masoud
    Participant

    @danbp
    first of all i have to thank you for your quick answer and great support.
    i am very satisfied with the support of this plugin. you guys are great.
    thank you very much.
    —-
    1 & 2 ) the function worked great, but the “private message” button in profile still remains!
    i mean if a user can not send message so there is no need to show them that button.
    is it possible to show that button only to admins too?

    3)
    oh no no. i didnt mean WP DASHBOARD.
    i dont want users to be able to change their email account on their own, after sign-up(bp sing up form), unless they contact admin of site, and request the change of email.
    the option of changing email account is in
    Setting Tab > General Tab
    there is a place for them to write their new email and …
    i want to hide and disable it for normal users and available only for admin.
    look at this picture please.
    the red area.

    danbp
    Participant

    @5high Yep! You’re right. The form is now build separately. To hide it conditionnaly, it’s much easier as previously.

    What you have to do from now on, is to add a condition on the template part call.

    The form template file is post-form.php (activity/post-form.php)

    On each activity template (swa, members, groups,…), there a call to this file. bp_get_template_part( 'activity/post-form' );

    To solve your problem, you have just to add the condition you want for this call.

    In your case, as you want to disallow the form only on swa and on member’s activity, you modify
    child-theme/buddypress/activity/index.php (site wide activity) and child-theme/buddypress/members/single/activity.php (profile activity)

    For example i hide the form to any user except site admin by using:

    if ( is_user_logged_in() && is_super_admin() )
    	bp_get_template_part( 'activity/post-form' );

    Hope to be clear ! 😉

    danbp
    Participant

    Give this a try: (add to bp-custom.php) 1) & 2):

    function bpfr_hide_tabs() {
    global $bp;
    
    	if ( bp_is_user() && !is_super_admin() ) {
    		bp_core_remove_nav_item( 'notifications' );
    		bp_core_remove_subnav_item( 'messages', 'compose' );
    	}
    	
    }
    add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );

    3) With BP and xprofile component activated, a user doesn’t need access to WP dashboard. He can change his profile credentials from front-end.
    Easiest way would be to use this plugin.

    Retrieving them the possibility to change their email is anyway not a good idea. What happen when a user changed from yahoo to gmail, but can’t login because he lost his password ? Where will the new pwd be sent ?

    Perhaps you have also to remove this from the BP usermenu on toolbar ?
    Here’s how you can do it:

    function admin_bar_remove_this(){
    global $wp_admin_bar;
    	$wp_admin_bar->remove_node('my-account-messages-compose');
    }
    add_action('wp_before_admin_bar_render','admin_bar_remove_this');
    Masoud
    Participant

    hi.
    i want to hide some tabs only for non-admins.
    for example “Compose
    underMessage > Compose.
    in bp-messages/classes/class-bp-component.php lines:199 & 287.
    it’s possible to add a conditional if().

    <strong>if(current_user_can(administrator))</strong>
    {
    $sub_nav[] = array(
    'name'=> __( 'Compose', 'buddypress' ),
    'slug'=> 'compose',
    'parent_url'=> $messages_link,
    'parent_slug'=> $slug,
    'screen_function'=> 'messages_screen_compose',
    'position'=> 30,
    'user_has_access'=> $access
    }

    and do this for line 287.
    so, both the Compose tab and the ability to composing a msg will be in admin hands.
    BUT it’s not a good way to hack core codes!
    so how can i do this?

    the things i want to hide from non-admins:
    1) Notification tab
    2) Compose (sub-nav)
    3) hide the panel and restrict the access to change Account email (from Setting > General)

    thanks in advance.

Viewing 25 results - 201 through 225 (of 691 total)
Skip to toolbar