Skip to content

Commit

Permalink
= 4.2.5.4 =
Browse files Browse the repository at this point in the history
  • Loading branch information
tungnxt89 committed Nov 4, 2023
1 parent 48fdfbc commit c5c6463
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions inc/TemplateHooks/Course/FilterCourseTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function __construct() {
*/
public function sections( array $data = [] ) {
wp_enqueue_script( 'lp-course-filter' );
ob_start();

try {
if ( ! isset( $data['fields'] ) ) {
$data['fields'] = [
Expand Down Expand Up @@ -82,9 +82,10 @@ public function sections( array $data = [] ) {
$sections[ $field ] = [ 'text_html' => $this->{'html_' . $field}( $data ) ];
}
}

ob_start();
Template::instance()->print_sections( $sections );
$content = ob_get_clean();
echo Template::instance()->nest_elements( $html_wrapper, $content );
echo Template::instance()->nest_elements( $html_wrapper, ob_get_clean() );
} catch ( Throwable $e ) {
ob_end_clean();
error_log( __METHOD__ . ': ' . $e->getMessage() );
Expand Down Expand Up @@ -237,11 +238,10 @@ public function html_price( array $data = [] ): string {

ob_start();
Template::instance()->print_sections( $sections );
$content_item = ob_get_clean();
echo Template::instance()->nest_elements( $html_wrapper, $content_item );
$content .= Template::instance()->nest_elements( $html_wrapper, ob_get_clean() );
}

$content = $this->html_item( esc_html__( 'Price', 'learnpress' ), ob_get_clean() );
$content = $this->html_item( esc_html__( 'Price', 'learnpress' ), $content );
} catch ( Throwable $e ) {
error_log( __METHOD__ . ': ' . $e->getMessage() );
}
Expand Down Expand Up @@ -408,7 +408,6 @@ public function html_author( array $data = [] ): string {
)
);

ob_start();
foreach ( $instructors as $instructor ) {
$html_wrapper = [
'<div class="lp-course-filter__field">' => '</div>',
Expand Down Expand Up @@ -442,13 +441,11 @@ public function html_author( array $data = [] ): string {

ob_start();
Template::instance()->print_sections( $sections );
$content_item = ob_get_clean();
echo Template::instance()->nest_elements( $html_wrapper, $content_item );
$content .= Template::instance()->nest_elements( $html_wrapper, ob_get_clean() );
}

$content = $this->html_item( esc_html__( 'Author', 'learnpress' ), ob_get_clean() );
$content = $this->html_item( esc_html__( 'Author', 'learnpress' ), $content );
} catch ( Throwable $e ) {
ob_end_clean();
error_log( __METHOD__ . ': ' . $e->getMessage() );
}

Expand All @@ -471,7 +468,6 @@ public function html_level( array $data = [] ): string {
$data_selected = explode( ',', $data_selected );
$fields = lp_course_level();

ob_start();
foreach ( $fields as $key => $field ) {
$html_wrapper = [
'<div class="lp-course-filter__field">' => '</div>',
Expand Down Expand Up @@ -508,11 +504,10 @@ public function html_level( array $data = [] ): string {

ob_start();
Template::instance()->print_sections( $sections );
$content_item = ob_get_clean();
echo Template::instance()->nest_elements( $html_wrapper, $content_item );
$content .= Template::instance()->nest_elements( $html_wrapper, ob_get_clean() );
}

$content = $this->html_item( esc_html__( 'Levels', 'learnpress' ), ob_get_clean() );
$content = $this->html_item( esc_html__( 'Levels', 'learnpress' ), $content );
} catch ( Throwable $e ) {
error_log( __METHOD__ . ': ' . $e->getMessage() );
}
Expand Down

0 comments on commit c5c6463

Please sign in to comment.