Last active
October 2, 2018 08:30
-
-
Save deckerweb/dd00884e81783e7d21046ae0a72ed683 to your computer and use it in GitHub Desktop.
Plugin: Builder Template Categories - Register regular WordPress Pages as an integration. That means to you categorize even those pages with your template categories ;-).
This file contains 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_filter( 'btc/filter/integrations/all', 'btc_register_integration_wordpress_pages' ); | |
/** | |
* Plugin: Builder Template Categories - Register custom integration. | |
* | |
* @author David Decker - DECKERWEB | |
* @link https://gist.github.com/deckerweb/dd00884e81783e7d21046ae0a72ed683 | |
* | |
* @param array $integrations Holds array of all registered integrations. | |
* @return array Tweaked array of registered integrations. | |
*/ | |
function btc_register_integration_wordpress_pages( array $integrations ) { | |
$post_type = 'page'; | |
$submenu_hook = 'edit.php?post_type=' . $post_type; | |
$template_label = 'template'; // or: library, layout, element, popup, lightbox, block, listing, post-type | |
$integrations[ 'your-custom-handle-lowercase' ] = array( | |
'label' => __( 'WordPress Pages as Templates', 'your-textdomain' ), | |
'submenu_hook' => $submenu_hook, | |
'post_type' => $post_type, | |
'template_label' => $template_label, | |
'admin_url' => 'edit.php?post_type=' . $post_type, | |
); | |
return $integrations; | |
} // end function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment