Courses::getUserCourseViewButtonLabel( $userId,  $courseId )

Returns dynamic label text based on user’s course progress

Description

Source

File: bp-integrations/learndash/buddypress/Courses.php

	public function getUserCourseViewButtonLabel($userId, $courseId)
	{
		$label  = __('Start Course', 'buddyboss');
		$status = learndash_course_status($courseId, $userId, true);

		if ('in-progress' === $status) {
			$label = __( 'Continue', 'buddyboss' );
		}

		if ('completed' === $status) {
			$label = __( 'View Course', 'buddyboss' );
		}

		return $label;
	}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.