[Plugin: Contact Form 7] Proper JavaScript Embedding Patch
-
Here are the diffs for the necessary modification to allow the contact form 7 scripts to be relocated by other plugins (such as footer-js) or whatever. In other words, the proper way to embed JavaScript from a plugin… Especially since this script depends on JQuery!
Index: /contact-form-7/wp-contact-form-7.php =================================================================== --- /plugins/contact-form-7/wp-contact-form-7.php (revision 117548) +++ /plugins/contact-form-7/wp-contact-form-7.php (working copy) @@ -693,7 +693,6 @@ }; //]]> </script> -<script type='text/javascript' src='<?php echo $javascript_url; ?>'></script> <?php } } @@ -1179,8 +1178,9 @@ } $javascript_url = WPCF7_PLUGIN_URL . '/contact-form-7.js'; + wp_enqueue_script('wp-contact-form-7',$javascript_url,array('jquery')); ?> -<script type='text/javascript' src='<?php echo $javascript_url; ?>'></script> + <?php }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[Plugin: Contact Form 7] Proper JavaScript Embedding Patch’ is closed to new replies.