Last active
December 11, 2015 23:18
-
-
Save rosshanney/4675469 to your computer and use it in GitHub Desktop.
Allow qTranslate to work on GCE Ajax calls
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
<?php | |
/* | |
Plugin name: Allow qTranslate to work on GCE Ajax calls | |
*/ | |
function gce_qtranslate() { | |
if ( function_exists( 'qtrans_getLanguage' ) ) { | |
$options = get_option( GCE_GENERAL_OPTIONS_NAME ); | |
wp_localize_script( 'gce_scripts', 'GoogleCalendarEvents', array( | |
'ajaxurl' => admin_url( 'admin-ajax.php?lang=' . qtrans_getLanguage(), is_ssl() ? 'https' : 'http' ), | |
'loading' => $options['loading'] | |
) ); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'gce_qtranslate', 99 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment