Remove specific unit type from all unit types

Add the following code to the customizer plugin remove the Elementor and Upload Package with their ID.
For another unit type remove to get the ID and add in the condition of IF like ‘elementor’ and ‘upload’ added.

add_filter('wplms_course_creation_tabs',function($tabs){
$types = $tabs['course_curriculum']['fields'][0]['curriculum_elements'][1]['types'];
$ntypes = [];
foreach ($types as $key => $type) {
if(!($type['id'] == 'elementor' || $type['id'] == 'upload')){
$ntypes[] = $type;
}
}
$tabs['course_curriculum']['fields'][0]['curriculum_elements'][1]['types'] = $ntypes;
return $tabs;
},999);

Leave a Reply

Your email address will not be published. Required fields are marked *