Last active
December 18, 2015 17:49
-
-
Save dancameron/a7059d5429f5af036533 to your computer and use it in GitHub Desktop.
Sprout Invoices Plugin/Theme Compatibility Example
This file contains hidden or 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 | |
/** | |
* Remove wp_footer hooks from an incompatible plugins and/or themes | |
*/ | |
function remove_wp_footer_actions() { | |
if ( is_single() && ( SI_Invoice::is_invoice_query() || SI_Estimate::is_estimate_query() ) ) { | |
// plugins usually hook on the default priority, also | |
// core doesn't add anything on priority 10 so | |
// we can assume all hooks are from plugins and themes. | |
remove_all_actions( 'wp_footer', 10 ); | |
} | |
} | |
add_action( 'template_redirect', 'remove_wp_footer_actions' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment