Last active
April 20, 2017 18:20
-
-
Save bnecreative/69260dedfa4b365a15438f3efc67e831 to your computer and use it in GitHub Desktop.
Allows adjusting the Flyout Args for Visual Composer
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
/* | |
* 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