Skip to content

Instantly share code, notes, and snippets.

@rosshanney
Created July 26, 2013 18:34
Show Gist options
  • Save rosshanney/6091185 to your computer and use it in GitHub Desktop.
Save rosshanney/6091185 to your computer and use it in GitHub Desktop.
Add jQuery migrate and fix JavaScript error
<?php
/*
Plugin name: Add jQuery migrate and fix JavaScript error
*/
function gce_add_jquery_migrate() {
wp_enqueue_script( 'jquery-migrate', 'http://code.jquery.com/jquery-migrate-1.2.1.min.js', array( 'jquery') );
}
function gce_fix_javascript_error() {
?>
<script type="text/javascript">jQuery.fn.dcAccordion = function() {};</script>
<?php
}
add_action( 'wp_enqueue_scripts', 'gce_add_jquery_migrate' );
add_action( 'wp_head', 'gce_fix_javascript_error', 99 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment