14,15d13
< 
< 
28a27
> 		add_action( 'wp_ajax_nopriv_infinite_scroll' ,  array( $this, 'infinite_scroll_func' ) );
37d35
< 		
49a48
> 
53a53,71
> 	/**
> 	* Infinite Scroll functionality added
> 	*/
> 
> 	public function infinite_scroll_func() {
> 		$off =	$_POST[ 'off' ];
> 		$off = $off + 1;
> 		if ( $tempEvents = $this->get_meetup_events( $off ) ) {
> 			usort( $tempEvents, array( $this, 'sort_events' ) );
> 			foreach ( $tempEvents as $event ) :
> 			echo( '
> 			<li>
> 				<a href="' . esc_attr( esc_url( $event->url ) ) . '">' . esc_html( $event->title ) . '</a><br />' .
> 				esc_html( date( "l, F jS | g:i a", (int) $event->start_timestamp ) ).'<br />'.
> 				esc_html( $event->location ) . '</li>' );
> 			endforeach;
> 		}
> 		wp_die();
> 	}
79a98
> 	
107c126
< 	 *
---
> 	 * @param $offset
110c129
< 	protected function get_meetup_events() {
---
> 	protected function get_meetup_events( $offset = 0 ) {
112d130
< 
116d133
< 		
118c135
< 			'%s2/events?group_id=%s&time=0,1m&page=%d&key=%s',
---
> 			'%s2/events?group_id=%s&time=0,1m&page=%d&offset=%d&key=%s',
121a139
> 			$offset,
179d196
< 	
246,248c263,264
< 
< require_once( __DIR__ . DIRECTORY_SEPARATOR . 'official-wordpress-event.php' );
< $GLOBALS['Official_WordPress_Events'] = new Official_WordPress_Events();
---
> 	require_once( __DIR__ . DIRECTORY_SEPARATOR . 'official-wordpress-event.php' );
> 	$GLOBALS['Official_WordPress_Events'] = new Official_WordPress_Events();
