Forked from SJ-James/auto-enable-divi-page-builder-cpt
Created
January 6, 2018 17:42
-
-
Save muks999/8b627c82053f27ed1a0e65ef282fa922 to your computer and use it in GitHub Desktop.
Auto-enable Divi Page Builder on all public custom post types (WooCommerce, LearnPress etc)
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 | |
// copy function into functions.php | |
function dpb_all_post_types( $post_types ) { | |
$args = array( | |
'public' => true, | |
'_builtin' => false | |
); | |
$output = 'names'; | |
$post_types = get_post_types( $args, $output ); | |
if ( $post_types ) { // If custom post types are present | |
foreach ( $post_types as $post_type ) { | |
$post_types[] ='$post_type'; | |
return $post_types; | |
} | |
} | |
} | |
add_filter( 'et_builder_post_types', 'dpb_all_post_types' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment