Skip to:
Content
Pages
Categories
Search
Top
Bottom

Disable Change Email Address?


  • yusareba
    Participant

    @yusareba

    In the settings (general) panel of buddypress, users can change their email address.

    How can I remove or disable this?

    If needed, I would be willing to use CSS but can’t find the identifier.

Viewing 6 replies - 26 through 31 (of 31 total)

  • yusareba
    Participant

    @yusareba

    hmm that’s incorrect. /settings/ is settings on it’s own

    /settings/notifications redirects to /settings/.

    It should work o.o


    Venutius
    Moderator

    @venutius

    /take a look at this then:

    function venutius_change_profile_settings_edit_tab() {
    
    	if( bp_is_active( 'xprofile' ) ) :
    	global $bp;
    	$access        = bp_core_can_edit_settings();
    	$slug          = bp_get_settings_slug();
    
    	$args = array(
    		'parent_slug'     => $slug,
    		'subnav_slug'	  => 'settings',
    		'screen_function' => 'bp_settings_screen_notification',
    		'user_has_access' => $access
    		);
     
    	bp_core_new_nav_default( $args );
    
    	bp_core_remove_subnav_item( BP_SETTINGS_SLUG, 'general' );
    //	bp_core_remove_subnav_item( BP_SETTINGS_SLUG, 'notifications' );
    	
    	bp_core_new_subnav_item( array( 
    	'name'            => __( 'Email' ), 
    	'slug'            => 'settings', 
    	
    	'parent_url'      => $bp->displayed_user->domain . $slug.'/', 
    
    	
    	'parent_slug'     => $slug, 
    	
    	'screen_function' => 'swapluisa',
    	'position'        => 1,
    	
    	) );
    
    	endif;
    
    }
    add_action( 'bp_actions', 'venutius_change_profile_settings_edit_tab' );

    This gives you two Email tabs, one is the original, one is the new one the way you want it. so long as the original one is there it works, but try uncommenting the code to remove the original tab, you get page not found on the settings page.


    yusareba
    Participant

    @yusareba

    I had to rename the function because I still want to keep the other one you provided. (they had the same function name)

    It didn’t seem to do anything, so I think i’ll make a video. I’m having a hard time explaining o.o

    I’ll reply within the next 2 hours


    Venutius
    Moderator

    @venutius

    On my system it creates two Email menu items, one pointing to settings, the other pointing to settings/notificatons.


    yusareba
    Participant

    @yusareba

    failed recording a vid.

    on my system it doesn’t do anything, but I don’t really need it to create or delete a menu item.

    only to change the URL that settings tab fetches.

    By default /settings/ is showing my notification options. This is because of the function that you provided earlier. (thank you for that btw).

    However I’m wanting to add to that, redirecting the ’email’ subnav to go to /settings/.

    If this is done, this will work as intended. There will be no 404.

    If it causes a 404 (It likely won’t) then I’ll revert back and have to find a different answer


    Russ Powers
    Participant

    @russwebguy

    Not sure if this is still relevant, but you can easily remove the email address field without having to remove the entire page. This can be accomplished by editing the BuddyPress template files you copied into your WordPress theme (wp-content/themes/mytheme/buddypress).

    The file you will want to edit is named general.php and is located in “wp-content/themes/mytheme/buddypress/members/single/settings”. Once you locate general.php, simply delete the following code located around line 27 and 28.

    <label for="email"><?php _e( 'Account Email', 'buddypress' ); ?></label>
    	<input type="email" name="email" id="email" value="<?php  echo bp_get_displayed_user_email(); ?>" class="settings-input" <?php bp_form_field_attributes( 'email' ); ?>/>

    Presto! No more email field 🙂

Viewing 6 replies - 26 through 31 (of 31 total)
  • You must be logged in to reply to this topic.
Skip to toolbar