bp_get_members_pagination_count()
Generate the members pagination count.
Description
Return
(string)
Source
File: bp-members/bp-members-template.php
function bp_get_members_pagination_count() { global $members_template; if ( empty( $members_template->type ) ) $members_template->type = ''; $start_num = intval( ( $members_template->pag_page - 1 ) * $members_template->pag_num ) + 1; $from_num = bp_core_number_format( $start_num ); $to_num = bp_core_number_format( ( $start_num + ( $members_template->pag_num - 1 ) > $members_template->total_member_count ) ? $members_template->total_member_count : $start_num + ( $members_template->pag_num - 1 ) ); $total = bp_core_number_format( $members_template->total_member_count ); if ( 'active' == $members_template->type ) { $pag = sprintf( _n( 'Viewing 1 member', 'Viewing %1$s - %2$s of %3$s members', $members_template->total_member_count, 'buddyboss' ), $from_num, $to_num, $total ); } elseif ( 'popular' == $members_template->type ) { $pag = sprintf( _n( 'Viewing 1 member with connections', 'Viewing %1$s - %2$s of %3$s members with connections', $members_template->total_member_count, 'buddyboss' ), $from_num, $to_num, $total ); } elseif ( 'online' == $members_template->type ) { $pag = sprintf( _n( 'Viewing 1 online member', 'Viewing %1$s - %2$s of %3$s online members', $members_template->total_member_count, 'buddyboss' ), $from_num, $to_num, $total ); } else { $pag = sprintf( _n( 'Viewing 1 member', 'Viewing %1$s - %2$s of %3$s members', $members_template->total_member_count, 'buddyboss' ), $from_num, $to_num, $total ); } /** * Filters the members pagination count. * * @since BuddyPress 1.5.0 * * @param string $pag Pagination count string. */ return apply_filters( 'bp_members_pagination_count', $pag ); }
Changelog
Version | Description |
---|---|
BuddyPress 1.5.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.