| 1 |
<?php |
| 2 |
/** |
| 3 |
* Viewer-facing presentation strings shared by the player, the public JS |
| 4 |
* config and the bundled theme framework. |
| 5 |
* |
| 6 |
* One accessor per string keeps the filter in a single place, so every |
| 7 |
* surface that shows the message agrees with what a theme decided. |
| 8 |
* |
| 9 |
* @package Wpstream |
| 10 |
*/ |
| 11 |
|
| 12 |
if ( ! defined( 'ABSPATH' ) ) { |
| 13 |
exit; |
| 14 |
} |
| 15 |
|
| 16 |
if ( ! function_exists( 'wpstream_not_live_message' ) ) { |
| 17 |
/** |
| 18 |
* The "we are not live" message shown while a channel is offline. |
| 19 |
* |
| 20 |
* Reads the configurable option and passes it through one filter. The |
| 21 |
* return is plain text — callers escape it for their context. |
| 22 |
* |
| 23 |
* @since 4.14.0 |
| 24 |
* |
| 25 |
* @param int $channel_id Channel post ID, or 0 when the message is not tied |
| 26 |
* to one channel (the player's shared JS config). |
| 27 |
* @return string Plain-text message. |
| 28 |
*/ |
| 29 |
function wpstream_not_live_message( $channel_id = 0 ) { |
| 30 |
// The option holds a site-wide custom message; the literal is the translated default. |
| 31 |
$message = (string) get_option( 'wpstream_you_are_not_live', __( 'We are not live at this moment', 'wpstream' ) ); |
| 32 |
|
| 33 |
/** |
| 34 |
* Filter the "we are not live" message. |
| 35 |
* |
| 36 |
* @since 4.14.0 |
| 37 |
* |
| 38 |
* @param string $message Plain-text message (not yet escaped). |
| 39 |
* @param int $channel_id Channel post ID, or 0 for the shared player config. |
| 40 |
*/ |
| 41 |
return (string) apply_filters( 'wpstream_not_live_message', $message, intval( $channel_id ) ); |
| 42 |
} |
| 43 |
} |
| 44 |
|