Created
February 4, 2015 11:14
-
-
Save philipjohn/b616ec58f5a44840d918 to your computer and use it in GitHub Desktop.
Fixes mixed content issues with Google Translate in Suffusion theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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