Browse: Home / Functions /

learndash_course_status_idx

learndash_course_status_idx( string $course_status_label = '' )

Gets the course status index from the course status label.


Description #

In various places with LD the course status is expressed as a string as in ‘Not Started’, ‘In Progress’ or ‘Complete’. the problem with using this string is it will be translated depending on the locale(). This means comparative logic can possible fails. The purpose of this function is to help use an internal key to keep track of the course status value.


Parameters #

$course_status_label

(string) (Optional) The current translatable text for course status.

Default value: ''


Return #

(string) The index/key of the course status string if found in the $learndash_course_statuses global array.


Source #

File: includes/course/ld-course-progress.php


Changelog #

Changelog
Version Description
2.3.0 Introduced.