From b4565dfceeb3a9ba84d2fea44d03b8ec65d7058b Mon Sep 17 00:00:00 2001 From: Derek Smart Date: Thu, 3 Jan 2019 17:01:35 -0500 Subject: [PATCH] AMP support: No need to run Comment Likes frontend so early. --- modules/comment-likes.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/comment-likes.php b/modules/comment-likes.php index c884b8e9c75f9..4fd73751adc8d 100644 --- a/modules/comment-likes.php +++ b/modules/comment-likes.php @@ -38,7 +38,7 @@ private function __construct() { $this->url_parts = parse_url( $this->url ); $this->domain = $this->url_parts['host']; - add_action( 'init', array( $this, 'frontend_init' ) ); + add_action( 'template_redirect', array( $this, 'frontend_init' ) ); add_action( 'admin_init', array( $this, 'admin_init' ) ); if ( ! Jetpack::is_module_active( 'likes' ) ) { @@ -117,10 +117,6 @@ public function add_like_count_column( $columns ) { } public function frontend_init() { - if ( is_admin() ) { - return; - } - if ( Jetpack_AMP_Support::is_amp_request() ) { return; }