Skip to content

Instantly share code, notes, and snippets.

@rosshanney
Last active December 11, 2015 23:18
Show Gist options
  • Save rosshanney/4675469 to your computer and use it in GitHub Desktop.
Save rosshanney/4675469 to your computer and use it in GitHub Desktop.
Allow qTranslate to work on GCE Ajax calls
<?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