Created
January 16, 2020 04:39
-
-
Save wpmudev-sls/750a64c667d1e61aa24ddc5a6addab56 to your computer and use it in GitHub Desktop.
[Forminator Pro] - Disable Google Translate on Calendar
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: [Forminator Pro] - Disable Google Translate on Calendar | |
* Description: [Forminator Pro] - Disable Google Translate on Calendar - 1156947707657883 | |
* Author: Thobk @ WPMUDEV | |
* Author URI: https://premium.wpmudev.org | |
* License: GPLv2 or later | |
*/ | |
if ( ! defined( 'ABSPATH' ) || ( defined( 'WP_CLI' ) && WP_CLI ) ) { | |
return; | |
} | |
add_action( 'after_setup_theme', 'wpmudev_forminator_fix_google_translate_calendar_func', 100 ); | |
function wpmudev_forminator_fix_google_translate_calendar_func() { | |
if ( defined('FORMINATOR_PRO') && class_exists( 'Forminator' ) ) { | |
add_action( 'wp_footer', 'wpmudev_forminator_fix_google_translate_calendar', 21 ); | |
function wpmudev_forminator_fix_google_translate_calendar(){ | |
echo "<script type='text/javascript'>(function ($, document, window) { | |
'use strict'; | |
$(function () { | |
if (typeof ($.fn.forminatorLoader) === 'undefined') { | |
// nothing to do here | |
} else { | |
var _disabled_gg_translate_on_calendar = 0; | |
$(document).on('after.load.forminator', function(e, form_id){ | |
if( ! _disabled_gg_translate_on_calendar ){ | |
var _calendar = $('#ui-datepicker-div'); | |
if( _calendar.length ){ | |
_calendar.addClass('notranslate'); | |
_disabled_gg_translate_on_calendar = 1; | |
} | |
} | |
}); | |
} | |
}); | |
}(window.jQuery, document, window))</script>"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment