Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'Hide Admin'

Viewing 25 results - 151 through 175 (of 634 total)
  • Author
    Search Results
  • #259293
    ckchaudhary
    Participant

    Hi Earl,
    Two things you can do:

    1. Hide admin user from members list. This post has some answers:- https://buddypress.org/support/topic/hide-admin-from-members-and-activity/
    2. Change the user_nicename field in users table in database, for the admin user.

    I suggest going with the first option.

    Brajesh Singh
    Participant

    Please put this code in your bp-custom.php

    
    function buddydev_hide_members_directory_from_all_except_admin() {
    
    	if ( bp_is_members_directory() && ! is_super_admin() ) {
    		//should we add a message too?
    		//bp_core_add_message( 'Private page.', 'error' );
    		bp_core_redirect( site_url('/') );
    	}
    }
    add_action( 'bp_template_redirect', 'buddydev_hide_members_directory_from_all_except_admin' );
    

    That should do it. Hoe it helps.

    danbp
    Participant

    @fearthemoose, @rezbiz,

    Here “the best guarded secret” finally revealed !
    But it’s not a secret, is part of Codex and a multi handled topic subject on this forum.

    What we want to do: remove access possibility.
    Where: on BuddyBar navigation menu (the one below the profile header).
    Specifics: make the activity and forum tabs only visible to the logged in user.

    NOTE: The activity tab is shown by default when you visit a profile.

    As we are going to hide/remove this tab to visitors, we need to define as first another default tab. If we won’t do that, the visitor will get a Page not found error. Which is not exactly the case here, the page exist but the visitor can’t access it.

    Let’s define arbitrary Profile as the new default tab. You can of course define what ever other existing tab on your BuddyBar as default.

    Add this line to bp-custom.php
    define( 'BP_DEFAULT_COMPONENT','profile' );

    Now the mega “open secret” !

    The folowing snippet contains almost any BP menu items you can have on a BuddyBar, and includes also the Forum item, in case you use bbPress.
    You can remove or comment out those you don’t want to use.
    Note also that it is only an example – you have to play with it to fit your need. But at least you have the right syntax to use.
    Note also that some profile menu items are user only, such as message or notice. In other words, these are always private.

    This function goes preferably to bp-custom.php

    function bpfr_hide_tabs() {
    global $bp;
    	 /**
    	 * class_exists() & bp_is_active are recommanded to avoid problems during updates 
    	 * or when Component is deactivated
    	 */
    
    	if( class_exists( 'bbPress' ) || bp_is_active ( 'groups' ) ) :
            
            /** here we fix the conditions. 
            * Are we on a profile page ? | is user site admin ? | is user logged in ?
            */
    	if ( bp_is_user() && !is_super_admin() && !is_user_logged_in() ) {
    
            /* and here we remove our stuff ! */
    		bp_core_remove_nav_item( 'activity' );
    		bp_core_remove_nav_item( 'friends' );
    		bp_core_remove_nav_item( 'groups' );
    		bp_core_remove_nav_item( 'forums' );
    	}
    	endif;
    }
    add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );

    Some other hints for privacy
    if you want to allow only the profile owner to view some tabs, replace
    !is_user_logged_in by !bp_is_my_profile() – this scenario doesn’t need a check for logged in users as it is made by bp_is_my_profile.

    If you want only to make a profile private, read here.

    If you want to remove a sub-nav item (ie. View on Profile), you use something like:
    bp_core_remove_subnav_item( 'profile', 'view' );

    Many other possibilities for navigation are also available, including for groups. Several examples are given on Codex, here.

    And if not enough, RTFM and search the forum ! 🙂

    Have fun !

    #258723
    ckchaudhary
    Participant

    If you are on latest version of buddypress( > 2.6 ), the following code will work:

    //hide setting nav in profile
    function w24dr_remove_settings_nav() {
        $bp = buddypress();
        $bp->members->nav->delete_nav( bp_get_settings_slug() );
    }
    add_action( 'bp_setup_nav', 'w24dr_remove_settings_nav' );
    
    //redirect settings to main profile page
    function w24dr_redirect_settings_nav(){
        if( bp_is_user() && bp_is_current_component( bp_get_settings_slug() ) ){
            wp_redirect( bp_displayed_user_domain() );
            exit();
        }
    }
    add_action( 'template_redirect', 'w24dr_redirect_settings_nav' );

    But it still doesn’t remove ‘settings’ nav from adminbar. You need to work some more to remove it from there.

    #258619
    jowyds
    Participant

    hello danbp, thanks for your reply.

    I have tried the suggestion to use define('WP_DEBUG', true); in conjuction with define('WP_DEBUG_LOG', true); with a twenty theme. It works fine when buddypress is not activated. No error or logfile whatsover. Then after I tried to activate buddypress, and test again. The media library still cannot load out. I have tried to check for error log and I can’t seems to find any.

    Nevertheless I found the culprit can be my bp-custom.php in which I put it just under /wp-content/plugins/[here]

    if I remove the file and everything seems works fine again with buddypress activated.

    This is the content for my bp-custom.php

    
    <?php
    // hacks and mods will go here
    
    /**
     * Make a site Private, works with/Without BuddyPress
     * 
     * @author sbrajesh
     * @global string $pagenow
     * 
     */
     
     /*
    function buddydev_private_site() {
        
        //first exclude the wp-login.php
        //register
        //activate
        global $pagenow;
        
        //do not restrict logged in users
        if( is_user_logged_in() ) {
            return ;
        }
        //if we are here, the user is not logged in, so let us check for exclusion
        //we selectively exclude pages from the list
        
        //are we on login page?
        if( $pagenow == 'wp-login.php' ) {
            return ;
        }
        
        //let us exclude the home page
        if( is_front_page() ) {
            return ;
        }
        
        $exclude_pages = array( 'register', 'activate', 'excelportfolio' );//add the slugs here
        
        //is it one of the excluded pages, if yes, we just return and don't care
        if( is_page( $exclude_pages ) ) {
            return ;
        }
        
        $redirect_url = wp_login_url( site_url('/') );//get login url,
        
        wp_safe_redirect( $redirect_url );
        exit( 0 );
    }
    
    */
     
    //add_action( 'template_redirect', 'buddydev_private_site', 0 );
    
    ?>
    
    <style type="text/css">
    
    #wp-admin-bar-bp-login {
    	display:none; /* JOWY: hide login link for buddypress. */
    }
    
    #wp-admin-bar-bp-register {
    	display:none; /* JOWY: hide register link for buddypress. */
    }
    
    #adminloginform {
    	color: #ffffff; /* JOWY: text color on form. */
    }
    
    #wpadminbar {
    	opacity: 0.7; /* JOWY: Opacity for wpadminbar. */
    }
    
    </style>
    

    what can possible went wrong?

    #258342
    Fantacular Designs
    Participant

    My brilliant husband is my coder… He figured out how to define the default component, and saved the day. I hope this helps others.

    define( 'BP_DEFAULT_COMPONENT', 'profile' );
    
    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( 'forums' );
    		bp_core_remove_nav_item( 'groups' );
    		bp_core_remove_nav_item( 'settings' );
    	}
    	
    }
    add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );
    #258281
    danbp
    Participant

    Hi,

    you can try to remove the private message button from the template or hide it with CSS.
    And add a custom one who leads to admin inbox.

    The link should look like
    http://your-site.com/members/YOU/messages/compose/?r=THE ADMIN&_wpnonce=an_alpha_numeric_value

    See here how you may code this

    Codex and Forum are your friends to search about template customization.

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

    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; ?>
Viewing 25 results - 151 through 175 (of 634 total)
Skip to toolbar