Skip to:
Content

BuddyPress.org

Changeset 8782


Ignore:
Timestamp:
08/10/2014 05:27:57 PM (10 years ago)
Author:
djpaul
Message:

Legacy forums: correctly use an integer for _n calls when building the pagination labels

Previously, the number used was the (string) return value from
bp_core_number_format. That function uses number_format_i8n
internally, which can return values such as “1,000” — which would cause
_n to pick the wrong singular/plural string at runtime.

See #5767

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-forums/bp-forums-template.php

    r8781 r8782  
    15251525            $pag_filter = sprintf( __( ' matching tag "%s"', 'buddypress' ), $forum_template->search_terms );
    15261526
    1527         return apply_filters( 'bp_get_forum_pagination_count', sprintf( _n( 'Viewing 1 topic', 'Viewing %1$s - %2$s of %3$s topics', $total, 'buddypress' ), $from_num, $to_num, $total, $pag_filter ), $from_num, $to_num, $total );
     1527        return apply_filters( 'bp_get_forum_pagination_count', sprintf( _n( 'Viewing 1 topic', 'Viewing %1$s - %2$s of %3$s topics', (int) $forum_template->total_topic_count, 'buddypress' ), $from_num, $to_num, $total, $pag_filter ), $from_num, $to_num, $total );
    15281528    }
    15291529
     
    21642164    $total = bp_core_number_format( $topic_template->total_post_count );
    21652165
    2166     echo apply_filters( 'bp_the_topic_pagination_count', sprintf( _n( 'Viewing 1 post', 'Viewing %1$s - %2$s of %3$s posts', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
     2166    echo apply_filters( 'bp_the_topic_pagination_count', sprintf( _n( 'Viewing 1 post', 'Viewing %1$s - %2$s of %3$s posts', (int) $topic_template->total_post_count, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
    21672167}
    21682168
Note: See TracChangeset for help on using the changeset viewer.