diff --git a/onesignal-public.php b/onesignal-public.php index 5b0a90c..14d2fc1 100644 --- a/onesignal-public.php +++ b/onesignal-public.php @@ -2,16 +2,6 @@ defined('ABSPATH') or die('This page may not be accessed directly.'); -function add_async_for_script($url) -{ - if (strpos($url, '#asyncload') === false) - return $url; - else if (is_admin()) - return str_replace('#asyncload', '', $url); - else - return str_replace('#asyncload', '', $url)."' async='async"; -} - class OneSignal_Public { public function __construct() @@ -77,13 +67,11 @@ public static function onesignal_header() OneSignal_Public::insert_onesignal_stamp(); } ?> 'async')); wp_enqueue_script('local_sdk'); } else { - wp_register_script('remote_sdk', 'https://cdn.onesignal.com/sdks/OneSignalSDK.js#asyncload', array(), false, true); + wp_register_script('remote_sdk', 'https://cdn.onesignal.com/sdks/OneSignalSDK.js', array(), '1.0.0', array('strategy' => 'async')); wp_enqueue_script('remote_sdk'); } ?>