Skip to:
Content

bbPress.org


Ignore:
Timestamp:
09/27/2017 09:14:36 AM (7 years ago)
Author:
johnjamesjacoby
Message:

Common: remove redundant calls to bbp_number_not_negative().

This change decreases the filter priority of out-of-range prevention from 10 to 8, and also adds filters to pre-formatted values in lieu of hard-coding this function into each individual count getter. This allows plugins to unplug this check more easily, and makes sure each value is only checked once for each call instead of occasionally twice in a row.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/users/options.php

    r6592 r6719  
    206206        }
    207207
    208         $count  = bbp_number_not_negative( get_user_option( '_bbp_topic_count', $user_id ) );
     208        $count  = get_user_option( '_bbp_topic_count', $user_id );
    209209        $filter = ( true === $integer )
    210210            ? 'bbp_get_user_topic_count_int'
     
    246246        }
    247247
    248         $count  = bbp_number_not_negative( get_user_option( '_bbp_reply_count', $user_id ) );
     248        $count  = get_user_option( '_bbp_reply_count', $user_id );
    249249        $filter = ( true === $integer )
    250250            ? 'bbp_get_user_reply_count_int'
     
    287287        $topics  = bbp_get_user_topic_count( $user_id, true );
    288288        $replies = bbp_get_user_reply_count( $user_id, true );
    289         $count   = bbp_number_not_negative( $topics + $replies );
     289        $count   = $topics + $replies;
    290290        $filter  = ( true === $integer )
    291291            ? 'bbp_get_user_post_count_int'
Note: See TracChangeset for help on using the changeset viewer.