WordPress filter hook
bbp_new_reply_pre_insert
Fired by 5 WordPress plugins, running on 201K+ sites between them.
“No Errors ************************************************************”
How to use bbp_new_reply_pre_insert
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'bbp_new_reply_pre_insert', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Argument names come from bbPress's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
5 plugins that fire bbp_new_reply_pre_insert
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
bbPress100,000+ installs
apply_filters( 'bbp_new_reply_pre_insert', array( 'post_author' => $reply_author, 'post_title' => $reply_title, 'post_content' => $reply_content, 'post_status' => $reply_status, 'post_parent' => $topic_id, 'post_type' => bbp_get_reply_post_type(), 'comment_status' => 'closed', 'menu_order' => bbp_get_topic_reply_count( $topic_id, true ) + 1 ) )includes/replies/functions.php:411 -
OttoKit: All-in-One Automation Platform80,000+ installs
apply_filters( 'bbp_new_reply_pre_insert', [ 'post_author' => $user_id, 'post_title' => '', 'post_content' => $reply_content, 'post_status' => $reply_status, 'post_parent' => $topic_id, 'post_type' => bbp_get_reply_post_type(), 'comment_status' => 'closed', 'menu_order' => bbp_get_topic_reply_count( $topic_id, false ) + 1, ] )src/Integrations/bbpress/actions/addreplyintopic.php:249 -
Bit integrations20,000+ installs
apply_filters( 'bbp_new_reply_pre_insert', [ 'post_author' => $data['reply_author'], 'post_title' => $data['reply_title'], 'post_content' => $data['reply_content'], 'post_status' => $reply_status, 'post_parent' => $topic_id, 'post_type' => bbp_get_reply_post_type(), 'comment_status' => 'closed', 'menu_order' => bbp_get_topic_reply_count($topic_id, false) + 1, ] )backend/Actions/BuddyBoss/RecordApiHelper.php:811 -
Forumax500+ installs
apply_filters( 'bbp_new_reply_pre_insert', array( 'post_author' => $reply_author, 'post_title' => $reply_title, 'post_content' => $reply_content, 'post_status' => $reply_status, 'post_parent' => $topic_id, 'post_type' => bbp_get_reply_post_type(), 'comment_status' => 'closed', 'menu_order' => bbp_get_topic_reply_count( $topic_id, true ) + 1 ) )lib/bbpress/includes/replies/functions.php:379 -
FV bbPress Tweaks10+ installs
apply_filters( 'bbp_new_reply_pre_insert', $data )comment-to-topic.php:155
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.