diff --git a/content/template/data/ogp.php b/content/template/data/ogp.php index b28080e5..21311bc2 100644 --- a/content/template/data/ogp.php +++ b/content/template/data/ogp.php @@ -39,13 +39,19 @@ $selected_course = json_decode( EDUAPIHelper()->GetOnDemandCourseDetailInfo( $course_id, $group_by_city ), true ); } + $description = ! empty( $selected_course['CourseDescriptionShort'] ) ? + $selected_course['CourseDescriptionShort'] : + $selected_course['CourseDescription']; + + if ( $description == null || strlen( $description ) == 0 ) { + return; + } + $description = wp_strip_all_tags( str_replace( [ "
", "
", "

" ], [ " ", " ", "

" ], - ! empty( $selected_course['CourseDescriptionShort'] ) ? - $selected_course['CourseDescriptionShort'] : - $selected_course['CourseDescription'] + $description ) );