“bp_core_get_users” filter and “per_page” parameter
-
In members-loop.php I’m applying filter to bp_core_get_users and after that all found users are on page, why?
function filter_bp_core_get_users($retval, $r) { if (isset($_REQUEST['members_search'])) { echo "<pre>";var_dump($r);echo"</pre>"; $retval = array('users', 'total'); $ar_uids = get_id_by_disp_name($_REQUEST['members_search']); foreach ($ar_uids as $key => $user) { $retval['users'][] = get_userdata( $user->ID ); } $retval['total'] = (!empty($ar_uids)) ? count($ar_uids) : 0 ; } return $retval; }; add_filter('bp_core_get_users', 'filter_bp_core_get_users', 10, 2);
In $r array there is “per_page” parameter and it equals to 20, but it doesn’t react with it. Members loop keep throwing me all, for example, 500 users which it found.
Sorry for bad English, not a native speaker.
- You must be logged in to reply to this topic.