Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save muks999/8b627c82053f27ed1a0e65ef282fa922 to your computer and use it in GitHub Desktop.
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)
<?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