Skip to content

Commit

Permalink
= 4.2.6.4 =
Browse files Browse the repository at this point in the history
~ Deprecated get_downloadable_material method.
  • Loading branch information
tungnxt89 committed Mar 7, 2024
1 parent d6d380c commit 6c74044
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions inc/course/abstract-course.php
Expand Up @@ -1453,11 +1453,12 @@ public function is_featured(): bool {
/**
* [get_downloadable_material get all material files of this course and lesson of this course]
* @return [array] [array of material files or empty array]
* @deprecated 4.2.6.4
*/
public function get_downloadable_material(): array {
/*public function get_downloadable_material(): array {
$material = LP_Material_Files_DB::getInstance();
$materials = $material->get_material_by_item_id( $this->get_id(), 1 );
return apply_filters( 'learn-press/course-materials', $materials, $this->get_id() );
}
}*/
}
}
6 changes: 4 additions & 2 deletions inc/lp-template-functions.php
Expand Up @@ -94,11 +94,13 @@ function learn_press_get_course_tabs() {
}

$file_per_page = LP_Settings::get_option( 'material_file_per_page', -1 );
if ( $course->get_downloadable_material() && $is_enrolled_course && (int) $file_per_page != 0 ) {
if ( $is_enrolled_course && (int) $file_per_page != 0 ) {
$defaults['materials'] = array(
'title' => esc_html__( 'Materials', 'learnpress' ),
'priority' => 45,
'callback' => LearnPress::instance()->template( 'course' )->func( 'metarials' ),
'callback' => function () {
do_action( 'learn-press/course-material/layout', [] );
},
);
}

Expand Down

0 comments on commit 6c74044

Please sign in to comment.