Skip to content

Commit

Permalink
Added cachebuster for stylesheet, and added class_exists checks for J…
Browse files Browse the repository at this point in the history
…etpack_AMP_Support
  • Loading branch information
ashicus committed May 21, 2020
1 parent 2b57eeb commit e4fd43d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/widgets/eu-cookie-law.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ function __construct() {
* Enqueue scripts and styles.
*/
function enqueue_frontend_scripts() {
wp_enqueue_style( 'eu-cookie-law-style', plugins_url( 'eu-cookie-law/style.css', __FILE__ ), array(), '20170403' );
wp_enqueue_style( 'eu-cookie-law-style', plugins_url( 'eu-cookie-law/style.css', __FILE__ ), array(), JETPACK__VERSION );

if ( ! Jetpack_AMP_Support::is_amp_request() ) {
if ( ! class_exists( 'Jetpack_AMP_Support' ) || ! Jetpack_AMP_Support::is_amp_request() ) {
wp_enqueue_script(
'eu-cookie-law-script',
Assets::get_file_url_for_environment(
Expand Down Expand Up @@ -159,7 +159,7 @@ public function widget( $args, $instance ) {

$instance = wp_parse_args( $instance, $this->defaults() );

if ( Jetpack_AMP_Support::is_amp_request() ) {
if ( class_exists( 'Jetpack_AMP_Support' ) && Jetpack_AMP_Support::is_amp_request() ) {
require dirname( __FILE__ ) . '/eu-cookie-law/widget-amp.php';
return;
}
Expand Down

0 comments on commit e4fd43d

Please sign in to comment.