Last active
August 17, 2018 11:12
-
-
Save deckerweb/07416fe610ed992650cbadfb77c5ee74 to your computer and use it in GitHub Desktop.
Plugin: Builder Template Categories - Code Snippet for removing an integration:
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 | |
/** 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