From d2a08c7355098051563dc718f44c953f33224f0d Mon Sep 17 00:00:00 2001 From: Vencislav Atanasov Date: Thu, 31 Oct 2024 01:10:15 +0200 Subject: [PATCH] Rework shortcode to use heredoc instead of output buffering --- functions.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/functions.php b/functions.php index a3da312..14e0229 100644 --- a/functions.php +++ b/functions.php @@ -208,9 +208,9 @@ function stream_player_shortcode($params = []) { wp_enqueue_style('video.js', 'https://unpkg.com/video.js/dist/video-js.css'); wp_enqueue_script('video.js', 'https://unpkg.com/video.js/dist/video.min.js'); - $videoJsConfig = [ + $vjsConfig = htmlspecialchars(json_encode([ 'fluid' => true, - ]; + ])); $params = array_merge([ 'host' => 'stream.openfest.org', @@ -219,15 +219,12 @@ function stream_player_shortcode($params = []) { $urlPrefix = 'https://' . $params['host'] . '/'; - ob_start(); -?> - -