Skip to content

Commit 51e4ffb

Browse files
committed
Merge branch 'instructor-analytics-free' into instructor-home-functionalities-free
2 parents 2ad455b + 20266d8 commit 51e4ffb

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

classes/Utils.php

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10949,34 +10949,16 @@ public function get_instructor_home_sortable_section() {
1094910949
*
1095010950
* @param string $template Template file path or slug.
1095110951
* @param array $data Data to be passed to the template.
10952-
* @param string $type Template type. Allowed values:
10953-
* - include
10954-
* - custom_template
10955-
* - template
10956-
* @param bool $tutor_pro Whether to load Tutor Pro template.
10952+
* @param bool $once Whether the template should be loaded only once.
10953+
* Defaults to true.
1095710954
*
1095810955
* @return string Rendered template output.
1095910956
*/
10960-
public function render_template( $template, $data, $type, $tutor_pro = false ) {
10957+
public function render_template( $template, $data, $once = true ) {
1096110958

1096210959
ob_start();
1096310960

10964-
switch ( $type ) {
10965-
case 'include':
10966-
include $template;
10967-
break;
10968-
10969-
case 'custom_template':
10970-
tutor_load_template_from_custom_path( $template, $data );
10971-
break;
10972-
10973-
case 'template':
10974-
tutor_load_template( $template, $data, $tutor_pro );
10975-
break;
10976-
10977-
default:
10978-
break;
10979-
}
10961+
tutor_load_template_from_custom_path( $template, $data, $once );
1098010962

1098110963
return (string) ob_get_clean();
1098210964
}

0 commit comments

Comments
 (0)