Skip to content

Instantly share code, notes, and snippets.

@philipjohn
Created February 4, 2015 11:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philipjohn/b616ec58f5a44840d918 to your computer and use it in GitHub Desktop.
Save philipjohn/b616ec58f5a44840d918 to your computer and use it in GitHub Desktop.
Fixes mixed content issues with Google Translate in Suffusion theme
Index: functions/actions.php
===================================================================
--- functions/actions.php (revision 43062)
+++ functions/actions.php (working copy)
@@ -1004,8 +1004,9 @@
}
if (!is_admin() && is_active_widget('Suffusion_Google_Translator', false, 'suf-google-translator', true)) {
+ $protocol = is_ssl() ? 'https' : 'http';
// For some reason the translation widget fails if we load the JS in the header. Hence we are overriding the header/footer JS setting
- wp_enqueue_script('suffusion-google-translate', 'http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit', array(), null, true);
+ wp_enqueue_script('suffusion-google-translate', $protocol . '://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit', array(), null, true);
}
$template_widths = suffusion_get_template_prefixes();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment