Created
October 13, 2012 12:38
-
-
Save zaerl/3884515 to your computer and use it in GitHub Desktop.
bbPress 1,000 count bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add_filter( 'bbp_get_topic_reply_count', 'bbp_number_format', 10 ); | |
add_filter( 'bbp_topic_reply_count', 'bbp_number_format', 10 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Output total reply count of a topic | |
* | |
* @since bbPress (r2485) | |
* | |
* @param int $topic_id Optional. Topic id | |
* @uses bbp_get_topic_reply_count() To get the topic reply count | |
*/ | |
function bbp_topic_reply_count( $topic_id = 0 ) { | |
$replies = bbp_get_topic_reply_count( $topic_id ); | |
return apply_filters( 'bbp_topic_reply_count', (int) $replies, $topic_id ); | |
} | |
/** | |
* Return total reply count of a topic | |
* | |
* @since bbPress (r2485) | |
* | |
* @param int $topic_id Optional. Topic id | |
* @uses bbp_get_topic_id() To get the topic id | |
* @uses get_post_meta() To get the topic reply count meta | |
* @uses apply_filters() Calls 'bbp_get_topic_reply_count' with the | |
* reply count and topic id | |
* @return int Reply count | |
*/ | |
function bbp_get_topic_reply_count( $topic_id = 0 ) { | |
$topic_id = bbp_get_topic_id( $topic_id ); | |
$replies = get_post_meta( $topic_id, '_bbp_reply_count', true ); | |
return apply_filters( 'bbp_get_topic_reply_count', (int) $replies, $topic_id ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment