Changeset 6296
- Timestamp:
- 02/21/2017 06:19:56 PM (8 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/core/filters.php
r6248 r6296 191 191 add_filter( 'bbp_get_form_reply_to', 'absint' ); 192 192 193 // Add number format filter to functions requ iring numeric output193 // Add number format filter to functions requesting formatted values 194 194 add_filter( 'bbp_get_user_topic_count', 'bbp_number_format', 10 ); 195 195 add_filter( 'bbp_get_user_reply_count', 'bbp_number_format', 10 ); … … 202 202 add_filter( 'bbp_get_topic_reply_count', 'bbp_number_format', 10 ); 203 203 add_filter( 'bbp_get_topic_post_count', 'bbp_number_format', 10 ); 204 add_filter( 'bbp_get_topic_revision_count', 'bbp_number_format', 10 ); 205 add_filter( 'bbp_get_reply_revision_count', 'bbp_number_format', 10 ); 204 206 add_filter( 'bbp_get_forum_topic_count_hidden', 'bbp_number_format', 10 ); 205 207 add_filter( 'bbp_get_topic_reply_count_hidden', 'bbp_number_format', 10 ); 208 209 // Add absint filter to functions expecting absolute values 210 add_filter( 'bbp_get_user_topic_count_int', 'intval', 10 ); 211 add_filter( 'bbp_get_user_reply_count_int', 'absint', 10 ); 212 add_filter( 'bbp_get_user_post_count_int', 'absint', 10 ); 213 add_filter( 'bbp_get_forum_subforum_count_int', 'absint', 10 ); 214 add_filter( 'bbp_get_forum_topic_count_int', 'absint', 10 ); 215 add_filter( 'bbp_get_forum_reply_count_int', 'absint', 10 ); 216 add_filter( 'bbp_get_forum_post_count_int', 'absint', 10 ); 217 add_filter( 'bbp_get_topic_voice_count_int', 'absint', 10 ); 218 add_filter( 'bbp_get_topic_reply_count_int', 'absint', 10 ); 219 add_filter( 'bbp_get_topic_post_count_int', 'absint', 10 ); 220 add_filter( 'bbp_get_forum_topic_count_hidden_int', 'absint', 10 ); 221 add_filter( 'bbp_get_topic_reply_count_hidden_int', 'absint', 10 ); 206 222 207 223 // Sanitize displayed user data -
trunk/src/includes/forums/template.php
r6291 r6296 1429 1429 * @param boolean $integer Optional. Whether or not to format the result 1430 1430 * @uses bbp_get_forum_id() To get the forum id 1431 * @uses get_post_meta() To get the forum post count 1431 * @uses bbp_get_forum_topic_count() To get the topic count 1432 * @uses bbp_get_forum_reply_count() To get the reply count 1432 1433 * @uses apply_filters() Calls 'bbp_get_forum_post_count' with the 1433 1434 * post count and forum id … … 1437 1438 $forum_id = bbp_get_forum_id( $forum_id ); 1438 1439 $topics = bbp_get_forum_topic_count( $forum_id, $total_count, true ); 1439 $meta_key = empty( $total_count ) ? '_bbp_reply_count' : '_bbp_total_reply_count'; 1440 $replies = (int) get_post_meta( $forum_id, $meta_key, true ); 1440 $replies = bbp_get_forum_reply_count( $forum_id, $total_count, true ); 1441 1441 $retval = $replies + $topics; 1442 $filter = ( true === $integer ) ? 'bbp_get_forum_post_count_int' : 'bbp_get_forum_post_count'; 1442 $filter = ( true === $integer ) 1443 ? 'bbp_get_forum_post_count_int' 1444 : 'bbp_get_forum_post_count'; 1443 1445 1444 1446 return apply_filters( $filter, $retval, $forum_id );
Note: See TracChangeset
for help on using the changeset viewer.