Hi @littlemisslanna,
Yep, but you have better to ask how to do that on Gravity Form support forum. We can help you here for BuddyPress usage, not for third party implementation. Sorry ! 😉
Ahh, I figured since it was the activity wall I was modifying that it’d be based here. Okay, thank you! I’ll share in this thread once I get how to do that thing if nobody minds 🙂
Ask GF for the hook re a form submission.
Then use that hook to call a function that uses bp_activity_add()
Thanks guys! So here’s what I got from the GF support guy.
add_action( 'gform_after_submission_5', 'gf_add_to_activity_stream', 10, 2 );
function gf_add_to_activity_stream( $entry, $form ) {
“Your custom PHP all needs to come after that, inside the new function gf_add_to_activity_stream”
I’m just not quite sure what to add after that. Can you guys help with this part, or should I bug the support guy again?
OK! So Gravity forms guy gave me this part.
// apply only to form 5 because of this: _5
add_action( 'gform_after_submission_5', 'gf_add_to_activity_stream', 10, 2 );
function gf_add_to_activity_stream( $entry, $form ) {
// log the $entry to see what you have to work with
GFCommon::log_debug( __METHOD__ . '(): ENTRY => ' . print_r( $entry, true ) );
// reference https://codex.buddypress.org/developer/function-examples/bp_activity_add/
$success = bp_activity_add( array ( $args ) );
GFCommon::log_debug( __METHOD__ . "(): Database record {$success} was created." );
}
I’m assuming the GF common log stuff would be what calls the entry from Gravity forms, but I’m not sure where/what to put as far as the buddypress stuff he referenced!