Last active
July 11, 2017 21:39
-
-
Save bnecreative/ccc89e69e9e3135d405a to your computer and use it in GitHub Desktop.
Flyout Restrictions for Post Types
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 | |
/* | |
* Custom Flyout Post Type Options | |
* | |
* By defualt, Flyouts restricts to WordPress post and page post types. | |
* The filter, bne_flyout_cmb_get_post_types, allows extending this | |
* to other post types. | |
* | |
* @note Requires BNE Flyouts v1.3 | |
* @param $post_types Returns an array of available post types. | |
* | |
*/ | |
function flyout_custom_post_types( $post_types ) { | |
// Set $post_types as an array | |
$post_types = array( | |
'post', // WP Post | |
'page', // WP Pages | |
'product', // WooCommerce Products | |
); | |
// Must return $post_types | |
return $post_types; | |
} | |
add_filter( 'bne_flyout_cmb_get_post_types', 'flyout_custom_post_types' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment