Filter
rpress_realtime_channel_name
On this page
Filters the realtime channel name for an order.
Runs in RPRESS_Realtime::build_channel_name(). The default is rpress-order-{payment ID}-{16 character HMAC of the payment key}. The same filtered name is used when publishing status events and when building the client config, so a filter must return a deterministic value for a given order.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$channel | string | Channel name. |
$payment_id | int | Payment ID. |
$payment_key | string | Payment key. |
Return value#
string. The channel name.
Example#
function my_realtime_channel_name( $channel, $payment_id, $payment_key ) {
return 'my-site-' . $channel;
}
add_filter( 'rpress_realtime_channel_name', 'my_realtime_channel_name', 10, 3 );
Notes#
The channel name is what keeps one customer's order updates private, so keep the hashed part of it unless you replace it with something equally unguessable.
Source#
Applied in:
includes/class-rpress-realtime.php(line 151), inRPRESS_Realtime::build_channel_name()
See also#
Was this page helpful?
