diff --git a/lib/client-assets.php b/lib/client-assets.php index 98fbf6d54..1a653242d 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -59,10 +59,12 @@ function novablocks_register_vendor_scripts() { wp_script_add_data( 'novablocks-velocity', 'crossorigin', 'anonymous' ); $google_maps_api_key = get_option( 'novablocks_google_maps_api_key', '' ); - wp_register_script( - 'google-maps', - '//maps.googleapis.com/maps/api/js?key=' . $google_maps_api_key . '&libraries=places' - ); + if ( ! empty( $google_maps_api_key ) ) { + wp_register_script( + 'google-maps', + '//maps.googleapis.com/maps/api/js?key=' . esc_attr( $google_maps_api_key ) . '&libraries=places' + ); + } // Comments related. /** The Rich Text Editor from Basecamp - Trix.