Skip to:
Content
Pages
Categories
Search
Top
Bottom

Disable name change for users


  • Snypa
    Participant

    @shoop

    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)

  • Snypa
    Participant

    @shoop

    Anyone able to help?


    Snypa
    Participant

    @shoop

    Any able to help?


    Boone Gorges
    Keymaster

    @boonebgorges

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


    Snypa
    Participant

    @shoop

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


    Snypa
    Participant

    @shoop

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


    LPH2005
    Participant

    @lph2005

    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/


    Snypa
    Participant

    @shoop

    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!!


    Snypa
    Participant

    @shoop

    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!!


    Boone Gorges
    Keymaster

    @boonebgorges

    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