Skip to content

Instantly share code, notes, and snippets.

@bnecreative
Last active April 20, 2017 18:20
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/69260dedfa4b365a15438f3efc67e831 to your computer and use it in GitHub Desktop.
Save bnecreative/69260dedfa4b365a15438f3efc67e831 to your computer and use it in GitHub Desktop.
Allows adjusting the Flyout Args for Visual Composer
/*
* Adjust Flyout Registration Args
*
* Sets the flyout post type to "public" allowing Visual Composer
* to be able to detect it and take over the editor. Note that because
* it is now public, Flyouts may be included in sitemaps and linked directly.
*
* To enable visual composer for BNE Flyouts, you would go to Visual Composer > Role Manager.
* Then under Administrator, choose custom in the post types select field and check the post
* types you want to make available including the bne_flyout one.
*
*
* Needs PHP 5.4+ & WP 4.4+
*
* Add to your theme's function.php
*
*
*/
add_filter( 'register_post_type_args', function( $args, $post_type ) {
if( 'bne_flyout' === $post_type ) {
$args['public'] = true;
}
return $args;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment