Home / Archive / MemberPress: Remove Accordion from Courses
Duplicate Snippet

Embed Snippet on Your Site

MemberPress: Remove Accordion from Courses

Use this snippet if you would like to remove the accordion CSS and JS from the MemberPress course overview and lesson sidebar.

Code Preview
php
<?php
function mepr_remove_accordion_class( $classes ) {
	//Course class body
	$cs_index = array_search( 'mpcs-course-with-accordion', $classes );
	if ( isset( $cs_index ) ) {
		unset( $classes[$cs_index] );
	}
	
	//Sidebar class body
	$sb_index = array_search( 'mpcs-sidebar-with-accordion', $classes );
	if ( isset( $sb_index ) ) {
		unset( $classes[$sb_index] );
	}
	
	return $classes;
}
add_filter('body_class', 'mepr_remove_accordion_class', 999);//Make sure it runs last

Comments

Add a Comment