Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Pagination no-ajax bug

@ripulkr

Participant

For now, I have implemented this fix :

add_filter('bp_get_messages_pagination','correct_buddypress_pagination');
add_filter('bp_get_members_pagination_links','correct_buddypress_pagination');
add_filter('bp_course_get_item_pagination','correct_buddypress_pagination');
function correct_buddypress_pagination($pagination){
	global $items_template;
	if($_GET['items_page'] || $_GET['mlpage'] || $_GET['mpage']){
		preg_match_all('/.+(mlpage|items_page|mpage).([1-9]+).+([1-9]+).+/',$pagination, $matches);
		if(isset($matches[2]) && isset($matches[3])){
			if(is_array($matches[2]) && count($matches[2])){
				foreach($matches[2] as $k=>$match){

					if($match != $matches[3][$k]){
						$search =$matches[1][$k]."=".$match."'>".$matches[3][$k];
						$replace=$matches[1][$k]."=".$matches[3][$k]."'>".$matches[3][$k];
						$pagination = str_replace($search,$replace,$pagination);
					}
				}
			}
		}
	}
	return $pagination;
}

I guess it should not have any impact when BuddyPress 2.2 update is released.

Skip to toolbar