Title: WP_HTTP_Polling_Sync_Server::get_updates
Published: May 20, 2026

---

# WP_HTTP_Polling_Sync_Server::get_updates( string $room, int $client_id, int $cursor, bool $is_compactor ): array{

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wp_http_polling_sync_server/get_updates/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/classes/wp_http_polling_sync_server/get_updates/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_http_polling_sync_server/get_updates/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_http_polling_sync_server/get_updates/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_http_polling_sync_server/get_updates/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_http_polling_sync_server/get_updates/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_http_polling_sync_server/get_updates/?output_format=md#wp--skip-link--target)

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

Gets sync updates for a specific client from a room after a given cursor.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/wp_http_polling_sync_server/get_updates/?output_format=md#description)󠁿

Delegates cursor-based retrieval to the storage layer, then applies client-specific
filtering and compaction logic.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_http_polling_sync_server/get_updates/?output_format=md#parameters)󠁿

 `$room`stringrequired

Room identifier.

`$client_id`intrequired

Client identifier.

`$cursor`intrequired

Return updates after this cursor.

`$is_compactor`boolrequired

True if this client is nominated to perform compaction.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_http_polling_sync_server/get_updates/?output_format=md#return)󠁿

 array{ end_cursor: int, should_compact: bool, room: string, total_updates: int,
updates: array<int, array{data: string, type: string}>, } Response data for this
room.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_http_polling_sync_server/get_updates/?output_format=md#source)󠁿

    ```php
    private function get_updates( string $room, int $client_id, int $cursor, bool $is_compactor ): array {
    	$updates_after_cursor = $this->storage->get_updates_after_cursor( $room, $cursor );
    	$total_updates        = $this->storage->get_update_count( $room );

    	// Filter out this client's updates, except compaction updates.
    	$typed_updates = array();
    	foreach ( $updates_after_cursor as $update ) {
    		if ( $client_id === $update['client_id'] && self::UPDATE_TYPE_COMPACTION !== $update['type'] ) {
    			continue;
    		}

    		$typed_updates[] = array(
    			'data' => $update['data'],
    			'type' => $update['type'],
    		);
    	}

    	$should_compact = $is_compactor && $total_updates > self::COMPACTION_THRESHOLD;

    	return array(
    		'end_cursor'     => $this->storage->get_cursor( $room ),
    		'room'           => $room,
    		'should_compact' => $should_compact,
    		'total_updates'  => $total_updates,
    		'updates'        => $typed_updates,
    	);
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/collaboration/class-wp-http-polling-sync-server.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/collaboration/class-wp-http-polling-sync-server.php#L581)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/collaboration/class-wp-http-polling-sync-server.php#L581-L607)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_http_polling_sync_server/get_updates/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_HTTP_Polling_Sync_Server::handle_request()](https://developer.wordpress.org/reference/classes/wp_http_polling_sync_server/handle_request/)`wp-includes/collaboration/class-wp-http-polling-sync-server.php` |

Handles request: stores sync updates and awareness data, and returns updates the client is missing.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_http_polling_sync_server/get_updates/?output_format=md#changelog)󠁿

| Version | Description | 
| [7.0.0](https://developer.wordpress.org/reference/since/7.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_http_polling_sync_server%2Fget_updates%2F)
before being able to contribute a note or feedback.