Skip to content

Instantly share code, notes, and snippets.

@deckerweb
Last active August 17, 2018 11:12
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 deckerweb/07416fe610ed992650cbadfb77c5ee74 to your computer and use it in GitHub Desktop.
Save deckerweb/07416fe610ed992650cbadfb77c5ee74 to your computer and use it in GitHub Desktop.
Plugin: Builder Template Categories - Code Snippet for removing an integration:
<?php
/** Do NOT include the opening php tag */
add_action( 'init', 'btc_tweak_remove_integration' );
/**
* Plugin: Builder Template Categories - Remove one or more integrations.
*
* @author David Decker - DECKERWEB
* @link https://gist.github.com/deckerweb/07416fe610ed992650cbadfb77c5ee74
*/
function btc_tweak_remove_integration() {
/**
* Array of integrations (their register function part) to remove.
*
* Note: For integration registering functions see the files in plugin
* folder '/integrations/'. Then look for the last part of the
* function name, like 'anywhere_elementor'.
*/
$integration_ids = array(
'wpbakery_templatera',
'cornerstone_global_blocks',
// 'thrive_lightboxes',
// 'your_custom_integration-whatever',
); // end array
/** Loop through every integration set for removal */
foreach ( $integration_ids as $integration_id ) {
/**
* Remove the original filter function for register, to avoid any futher
* loading
*/
remove_filter( 'btc/filter/integrations/all', 'ddw_btc_register_integration_' . $integration_id );
} // end foreach
} // end function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment