Skip to content

Commit 1581a5d

Browse files
committed
Fix print_script_data
1 parent 76e1580 commit 1581a5d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

php/class-plugin.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,12 @@ public function add_script_data( $slug, $value, $handle = null ) {
719719
* Output script data if set.
720720
*/
721721
public function print_script_data() {
722+
if ( ! isset( $this->settings ) || ! method_exists( $this->settings, 'get_param' ) ) {
723+
return;
724+
}
725+
722726
$handles = $this->settings->get_param( '@script' );
727+
723728
if ( ! empty( $handles ) ) {
724729
foreach ( $handles as $handle => $data ) {
725730
// 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.

0 commit comments

Comments
 (0)