Skip to content

Instantly share code, notes, and snippets.

@renventura
Last active November 27, 2022 02:07
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save renventura/062edef103469b1177bc to your computer and use it in GitHub Desktop.
Save renventura/062edef103469b1177bc to your computer and use it in GitHub Desktop.
Remove the Projects Post Type from Divi by Elegant Themes
<?php //* Mind this opening php tag
/**
* This will hide the Divi "Project" post type.
* Thanks to georgiee (https://gist.github.com/EngageWP/062edef103469b1177bc#gistcomment-1801080) for his improved solution.
*/
add_filter( 'et_project_posttype_args', 'mytheme_et_project_posttype_args', 10, 1 );
function mytheme_et_project_posttype_args( $args ) {
return array_merge( $args, array(
'public' => false,
'exclude_from_search' => false,
'publicly_queryable' => false,
'show_in_nav_menus' => false,
'show_ui' => false
));
}
@oloynet
Copy link

oloynet commented Oct 11, 2016

To remove the post type project, just add a blank function named et_pb_register_posttypes in your functions.php. It's works well in a child theme

function et_pb_register_posttypes() {
    // nothing - to remove post type : project
}

To remove the front builder from admin bar menu, if the page builder it not used, I've put the following code to my functions

function remove_et_front_editor_bar_menu() {
    if ( ! et_pb_is_pagebuilder_used( get_the_ID() ) ) {
        remove_action( 'admin_bar_menu', 'et_fb_add_admin_bar_link', 999 );
    }
}
add_action( 'admin_bar_init', 'remove_et_front_editor_bar_menu' );

@kileyohl
Copy link

THANK YOU!! Worked for me!

@chris-hotchkiss
Copy link

To remove the post type project, just add a blank function named et_pb_register_posttypes in your functions.php. It's works well in a child theme

function et_pb_register_posttypes() {
    // nothing - to remove post type : project
}

To remove the front builder from admin bar menu, if the page builder it not used, I've put the following code to my functions

function remove_et_front_editor_bar_menu() {
    if ( ! et_pb_is_pagebuilder_used( get_the_ID() ) ) {
        remove_action( 'admin_bar_menu', 'et_fb_add_admin_bar_link', 999 );
    }
}
add_action( 'admin_bar_init', 'remove_et_front_editor_bar_menu' );

This worked great for me. At least from what I can tell so far. I'll try to remember to update this thread if I do come across any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment