Skip to content

Update bundle courses view in student dashboard#2863

Merged
harunollyo merged 13 commits into
4.0.0-devfrom
update-dashboard-bundle
Jul 6, 2026
Merged

Update bundle courses view in student dashboard#2863
harunollyo merged 13 commits into
4.0.0-devfrom
update-dashboard-bundle

Conversation

@sazedul-haque

Copy link
Copy Markdown
Collaborator

No description provided.

@sazedul-haque sazedul-haque added the 4.0.0 Tutor v4.w0w label Jul 3, 2026
Comment thread classes/Icon.php Outdated
Comment thread models/CourseModel.php
public static function get_completed_courses_by_user( $user_id = 0, $offset = 0, $posts_per_page = -1, $args = array() ) {
$user_id = tutor_utils()->get_user_id( $user_id );
$course_ids = tutor_utils()->get_completed_courses_ids_by_user( $user_id );
$course_ids = tutor_utils()->get_completed_courses_ids_by_user( $user_id, false );

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is used in several places, we need to ensure all the called places context before passing 2nd param false.

Comment thread models/CourseModel.php
public static function get_active_courses_by_user( $user_id = 0, $offset = 0, $posts_per_page = -1, $args = array() ) {
$user_id = tutor_utils()->get_user_id( $user_id );
$course_ids = tutor_utils()->get_completed_courses_ids_by_user( $user_id );
$course_ids = tutor_utils()->get_completed_courses_ids_by_user( $user_id, false );

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Comment thread templates/dashboard/courses/course-card.php Outdated
Comment thread templates/dashboard/courses.php Outdated

$courses_tab = ( new Student() )->get_courses_tab( $active_tab, $post_type_args, $enrolled_course_count, $active_course_count, $completed_course_count );
// Separate count queries with no offset so tab counts are always accurate regardless of current page.
$enrolled_courses_for_count = CourseModel::get_enrolled_courses_by_user( get_current_user_id(), array( 'private', 'publish' ), 0, 1 );

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use constant instead of string

@harunollyo harunollyo merged commit 3e21afd into 4.0.0-dev Jul 6, 2026
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.0.0 Tutor v4.w0w

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants