Skip to content

Commit

Permalink
Nouveau: Fix pagination on a user's Following or Followers page.
Browse files Browse the repository at this point in the history
Requires BuddyPress 6.0.0.

See #97.
  • Loading branch information
r-a-y committed Apr 22, 2020
1 parent 8af25aa commit 49a1c0d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions _inc/users/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,30 @@ function bp_follow_add_member_scope_filter( $qs, $object ) {
}
add_filter( 'bp_ajax_querystring', 'bp_follow_add_member_scope_filter', 20, 2 );

/**
* Set pagination parameters when on a user Follow page for Nouveau.
*
* Nouveau has its own pagination routine...
*
* @since 1.3.0
*
* @param array $r Current pagination arguments.
* @param string $type Pagination type.
* @return array
*/
function bp_follow_set_pagination_for_nouveau( $r, $type ) {
if ( $GLOBALS['bp']->follow->following->slug !== $type && $GLOBALS['bp']->follow->followers->slug !== $type ) {
return $r;
}

return array(
'pag_count' => bp_get_members_pagination_count(),
'pag_links' => bp_get_members_pagination_links(),
'page_arg' => $GLOBALS['members_template']->pag_arg
);
}
add_filter( 'bp_nouveau_pagination_params', 'bp_follow_set_pagination_for_nouveau', 10, 2 );

/**
* Set some default parameters for a member loop.
*
Expand Down

0 comments on commit 49a1c0d

Please sign in to comment.