-
Notifications
You must be signed in to change notification settings - Fork 0
/
mootools-recaptcha-fix.php
32 lines (28 loc) · 1.02 KB
/
mootools-recaptcha-fix.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/**
* Mootools Recaptcha Error Workaround
*
* There is a javascript conflict caused by mootools.js (loaded by gantry)
* which prevents recaptcha.js (loaded by Gravityforms) from loading properly.
* This plugin loads a patch js file with a temporary workaround until Gantry
* releases a fixed version
*
* Learn more about issue here:
* @see https://github.com/google/recaptcha/issues/374#issuecomment-626999594
*
* Plugin Name: Mootools Recaptcha Error Workaround
* Description: Loads patch js file to fix mootools recaptcha conflict.
* Version: 1.0.0
* Author: Joseph Schultz
* Author URI: http://cuppajoey.com
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
function cj_load_patch_file() {
wp_register_script( 'cjmtr-patch', plugin_dir_url( __FILE__ ) . 'js/cjmtr-patch.js', array('jquery'), '1.0', true );
wp_enqueue_script( 'cjmtr-patch' );
}
add_action( 'wp_enqueue_scripts', 'cj_load_patch_file' );
?>