Using bp_activity_add() to update an activity
-
When using bp_activity_add() to update an activity, I am having a bit of a challenge. I have tried two approaches:
1. create an array of the elements needed to update, with a known activity id and pass them to bp_activity_add()
eg.
`$activity=array(‘id’=>533,’hide_sitewide’ => true,’content’=>’test 1′, ‘action’=>’test test’);
do_action(‘bp_activity_add’,$activity);`
2. Create an activity object and add assign the ID property and pass it to bp_activity_add()
eg.
`$activity = new BP_Activity_Activity ();
$activity->ID=533;
$activity->hide_sitewide=true;
$activity->content=”test 1″;
$activity->action=”test test”;
do_action(‘bp_activity_add’,$activity);`What am I missing? Is there a different way to do this?
Please advise.
- The topic ‘Using bp_activity_add() to update an activity’ is closed to new replies.