I was able to do this by adding this to my functions.php / custom plugin:
// Add custom fields to bbpress topics on front end
add_action ( 'bbp_theme_before_topic_form_content', 'bbp_extra_fields');
function bbp_extra_fields() {
$value = get_post_meta( bbp_get_topic_id(), 'YOUR-FIELD-NAME', true);
echo '<label for="bbp_extra_field">My Extra Field:</label><br>';
echo "<input type='text' name='YOUR-FIELD-NAME' value='".$value."'>";
}
//Save and update the values from the front end
add_action ( 'bbp_new_topic', 'bbp_save_extra_fields', 10, 1 );
add_action ( 'bbp_edit_topic', 'bbp_save_extra_fields', 10, 1 );
function bbp_save_extra_fields($topic_id=0) {
if (isset($_POST) && $_POST['YOUR-FIELD-NAME']!='')
update_post_meta( $topic_id, 'YOUR-FIELD-NAME', $_POST['YOUR-FIELD-NAME'] );
}
I think that’s correct but am in a bit of a code-haze at the moment! Hopefully it puts you on the right track at least. (And I can’t remember where I got the original code so apologies for not crediting original author)
Thank Pinkishhue for help!
Thank you all for your replies.
I have found this solution https://wordpress.org/plugins/gd-bbpress-attachments/screenshots/ which works perfectly!!
Regards,
Andreas