diff options
Diffstat (limited to 'plugins/jetpack/modules/comment-likes.php')
-rw-r--r-- | plugins/jetpack/modules/comment-likes.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/plugins/jetpack/modules/comment-likes.php b/plugins/jetpack/modules/comment-likes.php index 4fd73751..b40bd2f3 100644 --- a/plugins/jetpack/modules/comment-likes.php +++ b/plugins/jetpack/modules/comment-likes.php @@ -11,6 +11,8 @@ * Additional Search Queries: like widget, like button, like, likes */ +use Automattic\Jetpack\Assets; + Jetpack::dns_prefetch( array( '//widgets.wp.com', @@ -21,11 +23,12 @@ require_once dirname( __FILE__ ) . '/likes/jetpack-likes-master-iframe.php'; require_once dirname( __FILE__ ) . '/likes/jetpack-likes-settings.php'; class Jetpack_Comment_Likes { + public static function init() { static $instance = NULL; if ( ! $instance ) { - $instance = new Jetpack_Comment_Likes; + $instance = new Jetpack_Comment_Likes(); } return $instance; @@ -35,7 +38,7 @@ class Jetpack_Comment_Likes { $this->settings = new Jetpack_Likes_Settings(); $this->blog_id = Jetpack_Options::get_option( 'id' ); $this->url = home_url(); - $this->url_parts = parse_url( $this->url ); + $this->url_parts = wp_parse_url( $this->url ); $this->domain = $this->url_parts['host']; add_action( 'template_redirect', array( $this, 'frontend_init' ) ); @@ -101,7 +104,7 @@ class Jetpack_Comment_Likes { wp_enqueue_style( 'comment-like-count', plugins_url( 'comment-likes/admin-style.css', __FILE__ ), array(), JETPACK__VERSION ); wp_enqueue_script( 'comment-like-count', - Jetpack::get_file_url_for_environment( + Assets::get_file_url_for_environment( '_inc/build/comment-likes/comment-like-count.min.js', 'modules/comment-likes/comment-like-count.js' ), @@ -132,14 +135,14 @@ class Jetpack_Comment_Likes { wp_enqueue_style( 'jetpack_likes', plugins_url( 'likes/style.css', __FILE__ ), array( 'open-sans' ), JETPACK__VERSION ); wp_enqueue_script( 'postmessage', - Jetpack::get_file_url_for_environment( '_inc/build/postmessage.min.js', '_inc/postmessage.js' ), + Assets::get_file_url_for_environment( '_inc/build/postmessage.min.js', '_inc/postmessage.js' ), array( 'jquery' ), JETPACK__VERSION, false ); wp_enqueue_script( 'jetpack_resize', - Jetpack::get_file_url_for_environment( + Assets::get_file_url_for_environment( '_inc/build/jquery.jetpack-resize.min.js', '_inc/jquery.jetpack-resize.js' ), |