Last active
April 30, 2018 21:28
-
-
Save SJ-James/bab56876e724f2523a0e97196252f321 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' => true | |
); | |
$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