Re: buddypress-skeleton-component – saving to database?
Thanks @jeffsayre,
No errors & the save method seems to be receiving the data.
using:
function add_my_data( $field_1, $field_2, $field_3 ) {
global $bp;
$update = new BP_Example_TableName();
$update->field_1 = $field_1;
$update->field_2 = $field_2;
$update->field_3 = $field_3;
$save = $update->save();
return $save;
}
function data_to_add() {
add_my_data('100', '200','6');
}
if I add
add_action('wp','data_to_add');
the data is inserted on page load but if I use:
add_action('bp_activity_posted_update','data_to_add');
nothing gets added to the database.
Any ideas?