Skip to content

Commit

Permalink
Merge pull request Automattic#682 from deepakrohillas/fix/redditmedia…
Browse files Browse the repository at this point in the history
…_notfound

Liveblog embed.redditmedia.com javascript file returning 404
  • Loading branch information
GaryJones authored Jun 7, 2024
2 parents 9f95197 + 403d513 commit 5894514
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions classes/class-wpcom-liveblog-entry-embed-sdks.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class WPCOM_Liveblog_Entry_Embed_SDKs {
protected static $sdks = array(
'facebook' => 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5',
'twitter' => 'https://platform.twitter.com/widgets.js',
'instagram' => 'https://platform.instagram.com/en_US/embeds.js',
'reddit' => 'https://embed.redditmedia.com/widgets/platform.js',
'instagram' => 'https://www.instagram.com/embed.js',
'reddit' => 'https://embed.reddit.com/widgets.js',
);

/**
Expand All @@ -39,7 +39,9 @@ public static function enqueue() {
}

foreach ( self::$sdks as $name => $url ) {
wp_enqueue_script( $name, esc_url( $url ), array(), WPCOM_Liveblog::VERSION, false );
// Don't attach version with reddit js script file, it will generate 404 error with reddit js
$version = 'reddit' === $name ? null : WPCOM_Liveblog::VERSION;
wp_enqueue_script( $name, esc_url( $url ), array(), $version, false );
}
}

Expand Down

0 comments on commit 5894514

Please sign in to comment.