Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/04/2012 04:22:18 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Code Improvement:

  • Revert part of r4258.
  • Cast as int instead of using absint()
  • Fixes regression that broke existing bbPress plugin (hierarchical replies.)
  • Fixes #2008.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/forums/template-tags.php

    r4258 r4331  
    11771177    function bbp_get_forum_subforum_count( $forum_id = 0, $integer = false ) {
    11781178        $forum_id    = bbp_get_forum_id( $forum_id );
    1179         $forum_count = absint( get_post_meta( $forum_id, '_bbp_forum_subforum_count', true ) );
     1179        $forum_count = (int) get_post_meta( $forum_id, '_bbp_forum_subforum_count', true );
    11801180        $filter      = ( true === $integer ) ? 'bbp_get_forum_subforum_count_int' : 'bbp_get_forum_subforum_count';
    11811181
     
    12141214        $forum_id = bbp_get_forum_id( $forum_id );
    12151215        $meta_key = empty( $total_count ) ? '_bbp_topic_count' : '_bbp_total_topic_count';
    1216         $topics   = absint( get_post_meta( $forum_id, $meta_key, true ) );
     1216        $topics   = (int) get_post_meta( $forum_id, $meta_key, true );
    12171217        $filter   = ( true === $integer ) ? 'bbp_get_forum_topic_count_int' : 'bbp_get_forum_topic_count';
    12181218
     
    12511251        $forum_id = bbp_get_forum_id( $forum_id );
    12521252        $meta_key = empty( $total_count ) ? '_bbp_reply_count' : '_bbp_total_reply_count';
    1253         $replies  = absint( get_post_meta( $forum_id, $meta_key, true ) );
     1253        $replies  = (int) get_post_meta( $forum_id, $meta_key, true );
    12541254        $filter   = ( true === $integer ) ? 'bbp_get_forum_reply_count_int' : 'bbp_get_forum_reply_count';
    12551255
     
    12891289        $topics   = bbp_get_forum_topic_count( $forum_id, $total_count, true );
    12901290        $meta_key = empty( $total_count ) ? '_bbp_reply_count' : '_bbp_total_reply_count';
    1291         $replies  = absint( get_post_meta( $forum_id, $meta_key, true ) );
     1291        $replies  = (int) get_post_meta( $forum_id, $meta_key, true );
    12921292        $retval   = $replies + $topics;
    12931293        $filter   = ( true === $integer ) ? 'bbp_get_forum_post_count_int' : 'bbp_get_forum_post_count';
     
    13251325    function bbp_get_forum_topic_count_hidden( $forum_id = 0, $integer = false ) {
    13261326        $forum_id = bbp_get_forum_id( $forum_id );
    1327         $topics   = absint( get_post_meta( $forum_id, '_bbp_topic_count_hidden', true ) );
     1327        $topics   = (int) get_post_meta( $forum_id, '_bbp_topic_count_hidden', true );
    13281328        $filter   = ( true === $integer ) ? 'bbp_get_forum_topic_count_hidden_int' : 'bbp_get_forum_topic_count_hidden';
    13291329
Note: See TracChangeset for help on using the changeset viewer.