In the following WP php code:
function bbp_get_topic_post_count( $topic_id = 0, $integer = false ) {
$topic_id = bbp_get_topic_id( $topic_id );
$replies = (int) get_post_meta( $topic_id, '_bbp_reply_count', true ) + 1;
$filter = ( true === $integer ) ? 'bbp_get_topic_post_count_int' : 'bbp_get_topic_post_count';
return apply_filters( $filter, $replies, $topic_id );
}
I would like to change "$replies" by using filters. Since there is "apply_filters" above, I think it's possible to add "add_filter". But it seems that the filter name is "$filter"
function bbp_reply_count_modified( $replies, $topic_id ) {
$topic_id = bbp_get_topic_id( $topic_id );
$replies = (int) get_post_meta( $topic_id, '_bbp_reply_count', true ); // deleted '+ 1'
return $replies;
add_filter( '___________________', 'bbp_reply_count_modified', 10, 2 );
In this case, how can I create an "add_filter" function?
Thanks for your help.