Created
June 28, 2012 19:53
-
-
Save codehooligans/3013475 to your computer and use it in GitHub Desktop.
MarketPress scripts override
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 | |
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