Reply To: get_post_meta doesn’t work in activity stream
I cannot actually test it, but i guess it’s eventually a timing problem. Maybe the post meta data isn’t already stored into the database, when the activity is added.
Something like this:
1. Post is stored into the database
2. bp_activity_add() creates the activity
3. post_meta is stored into the database
The variable $cpt['secondary_item_id'] is holding the correct post_id. I have checked it. But maybe the post_meta isn’t there, when bp_activity_add() is called.
I will test it later with an already existing post.
I have also tried to set the filter priority to a higher value, so it’ll be called later, but that didn’t work too. :/