You should add extra fields as meta
function add_meta_to_activity( $content, $user_id, $activity_id ) {
bp_activity_update_meta( $activity_id, 'key', $_POST['value'] );
}
add_action( ‘bp_activity_posted_update’, ‘add_meta_to_activity’, 10, 3 );
Thank you for your quick answer, I’ve to add that code to bp-custom.php right?
and add a input field in the post form. you can then call the activity meta in your activity loop.
The code is working fine, the meta activity is created, but the only problem is that meta_value is empty, I’ve checked that the input name and $_POST value but still nothing!
This is my code on bp-custom.php
function add_meta_to_activity( $content, $user_id, $activity_id ) {
bp_activity_update_meta( $activity_id, 'option1', $_POST['option1'] );
}
add_action( 'bp_activity_posted_update', 'add_meta_to_activity', 10, 3 );
and this code on post-form.php inside the form tag
<li>option <input name="option1" id="option1" type="text" /></li>
any ideas why is not taking the $_POST value?
Thank you one more time for your help!