Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • @stevenkword

    Participant

    I’ve created a plugin to help add friends automatically upon new user registration.

    https://wordpress.org/extend/plugins/bp-automatic-friends/

    @stevenkword

    Participant

    Give this a try: Throw this code at the bottom of your functions.php. Make sure not to leave a trailing space.
    `
    //Disable members directory
    function disable_directory_members() {
    global $bp, $wp_query;
    $bp->is_directory = false;
    bp_core_redirect( $bp->root_domain );
    }
    add_action( ‘bp_core_action_directory_members’, ‘disable_directory_members’, 2 );
    `

    @stevenkword

    Participant

    I’m looking for this same information. Did you figure this out?

    I noticed a call to `bp_message_thread_id()` also returns empty regardless of its placement inside or outside of the loop.

    @stevenkword

    Participant

    @jeffsayre
    I believe this topic was started before the BP 1.0 release. I have still experiencing problems hooking into bp_setup_nav() and would like to know if altering the core files is the only way to solve the problem. I am currently testing using functions.php and have not been able to get the hook to fire.

    If I am understanding you correctly, I must do one of two things to correct the problem. 1.) Edit the bp-core and change the priority of bp_setup_nav or 2.) Put the add_action call for my plugin inside a file in a directory that alphabetically comes before “buddypress” ?

    @stevenkword

    Participant

    I came across this post today while researching using a similar method and I have found a work-around that is functional.
    It’s not uber-elegant, but it is functional. Here is how to do it.

    1.) Create a function that will update the wp-user usermeta to be the same as that of the xprofile.
    2.) Create a hook to update the wp-usermeta with the xprofile data everytime the profile is updated.
    3.) User the standard metakey / metavalue functions to pull the data back out.

    Here is a code sample that can go in functions.php in your theme:

    function copyUserMeta(){
    global $current_user;
    get_currentuserinfo();
    $user_id = $current_user->ID;

    $gender= xprofile_get_field_data( “Gender” ,$user_id);
    update_usermeta( $user_id, ‘gender’,$gender);

    $location = xprofile_get_field_data( “Location” ,$user_id);
    update_usermeta( $user_id, ‘location’,$location);
    }
    add_action( ‘bp_before_profile_edit_content’, ‘copyUserMeta’ );

    Then when you need to look up those values you can query using the standard user_meta calls.

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