Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding xprofile data in my Activity Stream

Viewing 8 replies - 1 through 8 (of 8 total)
  • Avatar of JoshtheDesigner
    JoshtheDesigner
    Participant

    @joshthedesigner

    Anyone?

    Avatar of shanebpdev
    shanebp
    Participant

    @shanebp

    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

    Avatar of JoshtheDesigner
    JoshtheDesigner
    Participant

    @joshthedesigner

    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.

    Avatar of shanebpdev
    shanebp
    Participant

    @shanebp

    Never put code into the buddypress plugin files.

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

    Avatar of JoshtheDesigner
    JoshtheDesigner
    Participant

    @joshthedesigner

    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?

    Avatar of shanebpdev
    shanebp
    Participant

    @shanebp

    > Any thoughts?

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

    Avatar of JoshtheDesigner
    JoshtheDesigner
    Participant

    @joshthedesigner

    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.

    Avatar of shanebpdev
    shanebp
    Participant

    @shanebp

    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)

You must be logged in to reply to this topic.