Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to edit bp profile data

Viewing 7 replies - 1 through 7 (of 7 total)
  • @fishbowl81

    Participant

    possibly,

    /**************************************************************************

    xprofile_admin_manage_field()

    Handles the adding or editing of profile field data for a user.

    **************************************************************************/

    function xprofile_admin_manage_field( $group_id, $field_id = null ) {

    global $message, $groups;

    $field = new BP_XProfile_Field($field_id);

    $field->group_id = $group_id;

    if ( isset($_POST) ) {

    if ( BP_XProfile_Field::admin_validate($_POST) ) {

    $field->name = $_POST;

    $field->desc = $_POST;

    $field->is_required = $_POST;

    $field->is_public= $_POST;

    $field->type = $_POST;

    $field->order_by = $_POST[“sort_order_$field->type”];

    if ( !$field->save() ) {

    $message = __(‘There was an error saving the field. Please try again’, ‘buddypress’);

    $type = ‘error’;

    unset($_GET);

    xprofile_admin($message, $type);

    } else {

    $message = __(‘The field was saved successfully.’, ‘buddypress’);

    $type = ‘success’;

    unset($_GET);

    $groups = $groups = BP_XProfile_Group::get_all();

    xprofile_admin( $message, $type );

    }

    } else {

    $field->render_admin_form($message);

    }

    } else {

    $field->render_admin_form();

    }

    }

    line 199, in bp-xprofile-admin.php,

    not really sure what you are asking

    Brad

    @decisionc

    Participant

    thanks brad. not sure how to use that function, tho.

    to be clearer, I wanted to know if I can ask my user: What do you want your new “Full Name” to be? in a form, and then take their new name, and replace the old full name in their profile with what they want.

    (obviously, I would also want to edit profile fields other than full name)

    is there a way to do this?

    @johnjamesjacoby

    Keymaster

    There currently isn’t a way for one user to edit another users extended buddypress information, admin or otherwise.

    Only way to do this at the moment would be through the database directly.

    @decisionc

    Participant

    thanks john.

    @hyrxx

    Participant

    there is a way to edit the users data, i have a plugin installed that allows you to go to users and then click a link and it logs you in as the selected user, obviously this means you can edit thier profile, the link only shows up for the site admin

    the plugin is: user switching – https://wordpress.org/extend/plugins/user-switching/

    the only annoyance is that once you switch users it means you must login again to get back to admin or watever, i.e. it doesnt allow switching back and forth between accounts

    it does help greatly though, hope this helps you

    @decisionc

    Participant

    thanks hyrxx. that helps for me to get started.

    @hyrxx

    Participant

    no problem i hope it works well for you until the component for editing profiles is developed

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to edit bp profile data’ is closed to new replies.
Skip to toolbar