Added get_pagination_query() method to Pagination. #6543