Skip to content

Instantly share code, notes, and snippets.

@bnecreative
Last active July 11, 2017 21:39
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 bnecreative/ccc89e69e9e3135d405a to your computer and use it in GitHub Desktop.
Save bnecreative/ccc89e69e9e3135d405a to your computer and use it in GitHub Desktop.
Flyout Restrictions for Post Types
<?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