Skip to content

fix(academy): show course steps in PublishPress workflow statuses - #1110

Merged
Genyus merged 1 commit into
developfrom
fix/learndash-workflow-statuses
Nov 11, 2026
Merged

Genyus merged 1 commit into
developfrom
fix/learndash-workflow-statuses

Conversation

@Genyus

@Genyus Genyus commented Nov 11, 2026

Copy link
Copy Markdown
Member

Problem

Lessons, topics and quizzes with a PublishPress Statuses workflow status (Ready, In Progress and so on) don't appear in a course's front-end listing, for anyone, including administrators. The course builder shows them correctly. Steps in Draft or Pending do appear.

In Data analytics: Full-time bootcamp (6988), this hides:

  • Engineering practices I (7188) and II (7206), which are Ready, with their topics and the skills check
  • every extended exercises topic under Analytics fundamentals, which are In Progress
  • Exploratory data analysis (7376), which is In Progress, with its topic and the Analytics fundamentals skills check (7379)

Cause

LDLMS_Course_Steps::get_step_post_statuses() (sfwd-lms/includes/classes/class-ldlms-model-course-steps.php) limits the steps query to get_post_stati( array( 'internal' => false, '_builtin' => true ) ), which is WordPress's built-in statuses only. Any step in a custom status is missing from the loaded objects, so get_lessons() and get_topics() drop it.

Fix

A new mu-plugin, cbf-learndash-workflow-statuses.php, uses the learndash_course_steps_post_status_keys filter to add the pre-publication workflow statuses: those with moderation set and without for_revision. That leaves out revision statuses, which belong to separate revision posts, and other plugins' statuses such as spam.

Visibility is unchanged. LDLMS_Model_Course::can_user_read_step() still drops unpublished steps for any viewer without read_post on them, just as it does for drafts.

Testing

I ran the filter on production in a wp eval that saved nothing:

  • As an administrator, the course listing goes from 45 to 48 lessons. Every hidden lesson, topic and quiz above is listed.
  • Logged out, the listing still shows only the 5 published lessons.

phpcs passes.

@Genyus
Genyus merged commit 9de6fc8 into develop Nov 11, 2026
4 checks passed
@Genyus
Genyus deleted the fix/learndash-workflow-statuses branch November 11, 2026 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant