Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding xprofile data in my Activity Stream

Viewing 8 replies - 1 through 8 (of 8 total)
  • @joshthedesigner

    Participant

    Anyone?

    @shanebp

    Moderator

    Use the ‘xprofile_updated_profile’ hook

    function josh_profile_check( $user_id, $posted_field_ids, $errors ) {
      /* check $posted_field_ids to see if one of the fields you are interested in has changed
      if yes, then use bp_activity_add to add to activity stream
      */
    }
    add_action( 'xprofile_updated_profile', 'josh_profile_check', 10, 3 );

    bp_activity_add

    @joshthedesigner

    Participant

    Thanks! Would I put this in the Functions file in my child-theme or in the buddypress/bp-activity/bp-activity-functions.php file? If it is in the activity functions where should I put it? Sorry I am still learning buddypress.

    @shanebp

    Moderator

    Never put code into the buddypress plugin files.

    Use your theme functions.php or use bp-custom.php.

    @joshthedesigner

    Participant

    Ok yes sorry I knew that. I tried to add it to my functions.php and I updated my profile but it did not show in the activity feed. I would like it to show in the activity feed if anyone updates their profile via the xprofile fields. It looks like from your code that it would only show if I update my profile. Any thoughts?

    @shanebp

    Moderator

    > Any thoughts?

    Use a service like gist to show the code that you tried.

    @joshthedesigner

    Participant

    I tried the exact code that you put in your first response. I put it in my Functions file then updated one of the xProfile fields and it was not in the activity feed.

    @shanebp

    Moderator

    Yikes – that was just a skeleton that needs actual code in the function.

    Given your code ability and the number of code requests you’ve recently made on these forums,
    I recommend that you post a job listing here.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Adding xprofile data in my Activity Stream’ is closed to new replies.
Skip to toolbar