6

I have been trying to sort this problem out for the last few days, here is an overview of my problem relating to

<?php bp_activity_id() ?>

I have 2 comment forms for a gallery plugin in buddy press, the first appears if there are no comments, and it 'creates' a activity it, the 2nd form appears if a comment has ever been made to and has the <?php bp_activity_id() ?> attached it it.

I would like to know how to automatically create a activity item as the first form cannot use features such as favorite or like as there is no id to associate with. I would like the 2nd form to be filled with an id, or in worst case scenario is it possible for some jquery/javascript to automatically add a comment and remove it ONCE (one time only) so that there is an ID? I can find more info if required, any really appreciate any help given!

Michael Berkowski
  • 267,341
  • 46
  • 444
  • 390

1 Answers1

3
$newActivity = bp_activity_add($args); // you dont NEED args, but you can pass them.
// $newActivity = the new activity's ID.

Source: http://www.buddydex.info/buddypress/bp-activity/bp_activity_add/

Applehat
  • 668
  • 4
  • 12