From 1581a5d6767e172fd37b6eed39523cfec18bf8d0 Mon Sep 17 00:00:00 2001 From: Aleksandar Atanasov Date: Fri, 25 Jul 2025 15:18:03 +0300 Subject: [PATCH] Fix print_script_data --- php/class-plugin.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/php/class-plugin.php b/php/class-plugin.php index 8ed2765b..364c3509 100644 --- a/php/class-plugin.php +++ b/php/class-plugin.php @@ -719,7 +719,12 @@ public function add_script_data( $slug, $value, $handle = null ) { * Output script data if set. */ public function print_script_data() { + if ( ! isset( $this->settings ) || ! method_exists( $this->settings, 'get_param' ) ) { + return; + } + $handles = $this->settings->get_param( '@script' ); + if ( ! empty( $handles ) ) { foreach ( $handles as $handle => $data ) { // We should never be using multiple handles. This is just for cases where data needs to be added where the main script is not loaded.