Skip to content

Instantly share code, notes, and snippets.

@deckerweb
Last active September 25, 2018 09:47
Show Gist options
  • Save deckerweb/cecc4d34f7d9f8c08bf44a855a9e4954 to your computer and use it in GitHub Desktop.
Save deckerweb/cecc4d34f7d9f8c08bf44a855a9e4954 to your computer and use it in GitHub Desktop.
Plugin: Builder Template Categories - Code Snippet for tweaking arguments of one or more integrations: #deckerweb #wordpress #plugin #customization
<?php
/** Do NOT include the opening php tag */
add_filter( 'btc/filter/integrations/all', 'btc_tweak_integration_args', 20, 1 );
/**
* Plugin: Builder Template Categories - Tweak arguments of integrations, for
* example labels.
*
* Note: The priority of the filter needs to be higher than 10, otherwise it
* won't work.
*
* @author David Decker - DECKERWEB
* @link https://gist.github.com/deckerweb/cecc4d34f7d9f8c08bf44a855a9e4954
*
* @param array $integrations Holds array of all registered integrations.
* @return array Tweaked array of registered integrations.
*/
function btc_tweak_integration_args( $integrations ) {
/** Tweak args of an integration */
$integrations[ 'wp-show-posts' ][ 'label' ] = __( 'Your Custom Label for WP Show Posts :)', 'your-custom-textdomain' );
$integrations[ 'jetengine' ][ 'label' ] = __( 'Your Custom Label for JetEngine :)', 'your-custom-textdomain' );
$integrations[ 'jetwoobuilder' ][ 'template_label' ] = 'layout';
$integrations[ 'wpbakery-templatera' ][ 'admin_url' ] = 'admin.php?page=my-custom-admin-page';
/** Return tweaked array of all integrations */
return $integrations;
} // end function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment