Ordering Courses in Product short description

Below tip will help you in re-ordering courses which are displayed in product short description.

For example :

 

 

 

add_filter('wplms_product_course_order_filter','wplms_rearrange_courses');
function wplms_rearrange_courses($courses){

foreach($courses as $course){
  $new_courses[get_post_field('menu_order',$course)]=$course;
}
$courses = ksort($new_courses); //Sort courses by Menu order value
return $courses;
}

 

Above code snippet will sort the courses based on the menu order value :

 

Leave a Reply

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