Skip to:
Content
Pages
Categories
Search
Top
Bottom

Disable name change for users

  • @shoop

    Participant

    Guys this is urgent, i want to disable the change name feature as many of you guys know it leads to alot of confussion and users shouldnt be aloud to change thier names anyways. Please help!

Viewing 9 replies - 1 through 9 (of 9 total)
  • @shoop

    Participant

    Anyone able to help?

    @shoop

    Participant

    Any able to help?

    @boonebgorges

    Keymaster

    Try this on for size. Hackish but functional, until real exclude arguments exist (they’re coming in 1.3, I promise!) Put it in your bp-custom.php

    `function bbg_disallow_name_edit( $has_profile ) {
    global $profile_template, $bp;

    if ( ‘edit’ != $bp->current_action || !bp_is_my_profile() )
    return $has_profile;

    foreach( (array)$profile_template->groups as $group_key => $group ) {
    foreach( (array)$group->fields as $field_key => $field ) {
    if ( $field->name == BP_XPROFILE_FULLNAME_FIELD_NAME ) {
    unset( $profile_template->groups[$group_key]->fields[$field_key] );
    $profile_template->groups[$group_key]->fields = array_values(
    $profile_template->groups[$group_key]->fields );
    break 2;
    }
    }
    }

    return $has_profile;
    }
    add_filter( ‘bp_has_profile’, ‘bbg_disallow_name_edit’ );`

    @shoop

    Participant

    Thank you mate, I will try this now. Btw in wordpress version 1.3, will be able to disable this part of the profile?

    @shoop

    Participant

    Sorry, i cant find the bp.customs.php file..

    @lph2005

    Participant

    bp-custom.php is a file you may create and place in the wp-content/plugins/ directory.

    https://codex.buddypress.org/buddypress-site-administration/bp-custom-php/

    @shoop

    Participant

    ok great it works, just one question. How come i got the button base showing now? It doesnt do anything and what is base? Dont understand why its there, Thanks!!

    @shoop

    Participant

    just one question. How come i got the button base showing now? It doesnt do anything and what is base? Dont understand why its there, Thanks!!

    @boonebgorges

    Keymaster

    Please don’t bump your post more than once per day, especially on the weekend.

    The Base button corresponds to the Base profile fields group. There is no easy way to turn this off at this time.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Disable name change for users’ is closed to new replies.
Skip to toolbar