Skip to content

Instantly share code, notes, and snippets.

@codehooligans
Created June 28, 2012 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codehooligans/3013475 to your computer and use it in GitHub Desktop.
Save codehooligans/3013475 to your computer and use it in GitHub Desktop.
MarketPress scripts override
<?php
function mp_js_override() {
global $mp;
if (!is_object($mp)) return;
// #1 - Disable AJAX on the Product page.
remove_action( 'template_redirect', array(&$mp, 'store_script') ); //only on front pages
// #2 - Deregister the MP script(s) and reregister in the footer.
wp_deregister_script( 'mp-store-js');
wp_enqueue_script( 'mp-store-js', $mp->plugin_url . 'js/store.js', array('jquery'), $mp->version, true );
}
add_action( 'init', 'mp_js_override', 99 );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment