Skip to content

Instantly share code, notes, and snippets.

@dancameron
Last active December 18, 2015 17:49
Show Gist options
  • Save dancameron/a7059d5429f5af036533 to your computer and use it in GitHub Desktop.
Save dancameron/a7059d5429f5af036533 to your computer and use it in GitHub Desktop.
Sprout Invoices Plugin/Theme Compatibility Example
<?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