Skip to content
Docs
Get RestroPress

Filter

rpress_realtime_config

Updated
On this page

Filters the realtime provider configuration.

Runs in RPRESS_Realtime::get_provider_config() with defaults read from the realtime settings or the RPRESS_REALTIME_* constants. The returned array is merged over the defaults and then sanitised, so keys can be partially overridden. Keys include provider, app_id, key, secret, cluster, host, port, scheme, use_tls, client_script_url, client_ws_host, client_ws_port, client_wss_port and enabled_toggle. Realtime is only active when the provider is pusher and the app ID, key, secret, host and port are all set.

Parameters#

ParameterTypeDescription
$defaultsarrayProvider configuration defaults.

Return value#

array. The provider configuration.

Example#

function my_realtime_config( $config ) {
	$config['cluster'] = 'eu';
	return $config;
}
add_filter( 'rpress_realtime_config', 'my_realtime_config' );

Notes#

Used for both publishing and the client config, and includes the secret. Do not expose the filtered array to the browser.

Source#

Applied in:

  • includes/class-rpress-realtime.php (line 256), in RPRESS_Realtime::get_provider_config()

See also#

Was this page helpful?