Skip to content

Commit

Permalink
Forcing ssl since twitch redirects there anyway
Browse files Browse the repository at this point in the history
  • Loading branch information
shapeyourbits committed Sep 29, 2023
1 parent 35c8dfb commit 74b546b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions online-indicator-for-twitch.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function sanitize_oift_larger_than($input) {return wp_kses_post(force_balance_ta
function oift_footer() {
?>
<?php if( get_theme_mod('oift_channel_name') != '') { ?>
<div id="oift-container"><a class="oift-twitch" <?php if( get_theme_mod('oift_new_window') != '') { ?>target="_blank"<?php } ?> href="<?php if(wp_is_using_https()){ ?>https<?php }else{ ?>http<?php } ?>://www.twitch.tv/<?php echo get_theme_mod('oift_channel_name'); ?>">
<div id="oift-container"><a class="oift-twitch" <?php if( get_theme_mod('oift_new_window') != '') { ?>target="_blank"<?php } ?> href="https://www.twitch.tv/<?php echo get_theme_mod('oift_channel_name'); ?>">
<span class="oift-status-text-live">
<?php if( get_theme_mod('oift_live_text') != '') { ?>
<?php echo get_theme_mod('oift_live_text'); ?>
Expand All @@ -186,7 +186,7 @@ function oift_footer() {
add_action('wp_footer','oift_footer');

function oift_front_end_scripts() {
wp_register_script( 'oift-twitch', 'http://embed.twitch.tv/embed/v1.js', array(), '1.0', true ); // one day wordpress will support crossorigin="anonymous"
wp_register_script( 'oift-twitch', 'https://embed.twitch.tv/embed/v1.js', array(), '1.0', true ); // one day wordpress will support crossorigin="anonymous"
wp_enqueue_script('oift-twitch');
wp_add_inline_script( 'oift-twitch', "
var oift_stream = new Twitch.Embed('oift-embed', {width: 340,height: 400,channel: '".get_theme_mod('oift_channel_name')."',layout: 'video'});
Expand Down

0 comments on commit 74b546b

Please sign in to comment.