Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)

  • a608237
    Participant

    @a608237

    So this is a very hacky way i’m doing it. I noticed using xprofile_set_field_data to set the data for an extended profile field only works temporarily. However, overwriting an existing default profile field (i.e. Facebook, Snapchat) seems to stay permanently.

    xprofile_set_field_data('Snapchat', $current_user->ID, $avatar_path);

    So as admin, I went in and changed the name of the default profile field to my desired one (i.e. Snapchat -> path) and applied

    add_filter( 'xprofile_updated_profile', 'update_xprof' );
    
    function update_xprof() {
    $path=bp_core_fetch_avatar();
    xprofile_set_field_data('path', $current_user->ID, $path); 
    }

    This way works more or less. However, I noticed that the function only kicks in when the user literally clicks ‘Edit’ and changes the data in her/his profile from the front end.

    This function does not kick in whenever the user changes his/her avatar. I tried to use
    xprofile_avatar_uploaded in place of xprofile_updated_profile, but with it, the function doesn’t seem to work at all. Can someone comment on why?


    a608237
    Participant

    @a608237

    I’ve decided to create a hidden xprofile field to store this data, but using xprofile_set_field_data only seems to work temporarily, after several minutes, the entire row containing the data disappears from wp_bp_xprofile_data. How can I make this permanent?

    add_action( 'bp_setup_nav', 'write_path' );
    function write_path() {
    	global $bp;
            global $current_user;
    
            $avatar_path = bp_core_fetch_avatar('html=false'); 
            xprofile_set_field_data('path', $current_user->ID, $avatar_path); 
    }

    a608237
    Participant

    @a608237

    it’s possible to user home tab specific content by inserting it into members/single/plugins.php


    a608237
    Participant

    @a608237

    On further review, disabling bootstrap 3 enqueing in the child theme functions.php fixed this.


    a608237
    Participant

    @a608237

    Thanks Venutius,

    I am slightly closer to what I want to achieve. There is something slightly odd about the way it appears on the front end using those hooks: before each ‘block’ of fields (i.e. Base, Profile, extended) it seems my_function is called once, but it is not in a loop of any sort.

    Is there a way to get it to call my_function say.. before the Base Fields?


    a608237
    Participant

    @a608237

    i deleted that user’s rows from wp_usermeta also and it still says that user’s name is already taken during registration. I think I may have learned my lesson.. you wouldn’t happen to know where else I need to delete data to finally rid the user would you?

    Would you recommend testing the login/reg system by deleting accounts from the buddypress interface?

Viewing 6 replies - 1 through 6 (of 6 total)
Skip to toolbar