Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Form to forum

@barryhughes-1

Participant

Well, if you’re building on my example code you could make a few changes in order to get the information flowing back to the success message:

# Find this line
bbp_insert_topic( /* ... */ );

# Change it: let's catch the post ID
$topic_id = bbp_insert_topic( /* ... */ );

# Find this line
post_to_bbp_status( 'success' );

# Change it: let's pass the post ID instead of 'success'
post_to_bbp_status( $topic_id );

# Find this condition
if ( 'success' === post_to_bbp_status() )

# Change it: test to see if it contains a post ID
if ( is_numeric( post_to_bbp_status() ) )

# Find the line
return 'Thank you for your submission.';

# Change it: display the new topic's permalink
return 'Check your post: ' . get_permalink( post_to_bbp_status() );

Note that these changes are untested, they don’t do any safety checks etc etc. However, I hope it gives you some ideas you can use to further develop your own solution 🙂

Skip to toolbar