@@ -420,7 +420,6 @@ function eduadmin_get_detailinfo( $attributes ) {
420420 'courseinquiryurl ' => null ,
421421 'order ' => null ,
422422 'orderby ' => null ,
423- 'ondemand ' => false ,
424423 'allcourses ' => false ,
425424 ),
426425 normalize_empty_atts ( $ attributes ),
@@ -464,18 +463,18 @@ function eduadmin_get_detailinfo( $attributes ) {
464463 $ fetch_months = 6 ;
465464 }
466465
467- if ( ! $ attributes ['ondemand ' ] ) {
468- $ edo = EDUAPIHelper ()->GetCourseDetailInfo ( $ course_id , $ fetch_months , $ group_by_city );
469- } else {
470- $ edo = EDUAPIHelper ()->GetOnDemandCourseDetailInfo ( $ course_id , $ group_by_city );
471- }
472-
473- $ selected_course = false ;
466+ $ edo = EDUAPIHelper ()->GetCourseDetailInfo ( $ course_id , $ fetch_months , $ group_by_city );
474467
475468 if ( ! empty ( $ edo ) ) {
476469 $ selected_course = json_decode ( $ edo , true );
477470 }
478471
472+ $ is_ondemand = $ selected_course ['OnDemand ' ];
473+
474+ if ( $ is_ondemand ) {
475+ $ selected_course = json_decode ( EDUAPIHelper ()->GetOnDemandCourseDetailInfo ( $ course_id , $ group_by_city ), true );
476+ }
477+
479478 if ( ! is_array ( $ selected_course ) ) {
480479 EDU ()->stop_timer ( $ t );
481480
@@ -742,7 +741,7 @@ function eduadmin_get_detailinfo( $attributes ) {
742741 $ ret_str .= ' data-orderby=" ' . esc_attr ( $ custom_order_by_order ) . '" ' ;
743742 $ ret_str .= ' data-showvenue=" ' . esc_attr ( EDU ()->is_checked ( 'eduadmin-showEventVenueName ' , false ) ) . '" ' ;
744743 $ ret_str .= ' data-eventinquiry=" ' . esc_attr ( EDU ()->is_checked ( 'eduadmin-allowInterestRegEvent ' , false ) ) . '" ' ;
745- $ ret_str .= ' data-ondemand=" ' . esc_attr ( $ attributes [ ' ondemand ' ] ) . '" ' ;
744+ $ ret_str .= ' data-ondemand=" ' . esc_attr ( $ is_ondemand ) . '" ' ;
746745 $ ret_str .= ' data-allcourses=" ' . esc_attr ( $ attributes ['allcourses ' ] ) . '" ' ;
747746 $ ret_str .= '> ' ;
748747
0 commit comments