Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: customize avatar file name

@a608237

Participant

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); 
}
Skip to toolbar