strangerstudios / pmpro-courses

Create courses with lessons and manage member access access natively in Paid Memberships Pro. Also integrates membership with third party LMS plugins like LifterLMS, LearnDash, Tutor LMS, and Sensei LMS.
https://www.paidmembershipspro.com/add-ons/pmpro-courses-lms-integration/
3 stars 12 forks source link

Allow a lesson saved to draft to be assigned to a course #45

Open MaryOJob opened 1 year ago

MaryOJob commented 1 year ago

When a draft lesson is not yet published, it cannot be added to a course.

A site owner might want to create a course with a future publishing date, but have all their content (lessons) ready and assigned to the said course and saved in the draft, if they are not able to add the lessons saved to the draft, they would need to wait till the day of publishing to publish all lessons then add to the course.

andrewlimaza commented 1 year ago

This would require a bit more thought around doing this, as we'd most likely have to do it for all modules.

Releasing this into production would need more thought as the current temporary workaround for this does the job, but it will cause some 404 links - I think we should handle that better once we look into this feature in more detail.

Temporary solution

You will need to ensure that you change or add in 'post_status' => array( 'publish', 'draft' ) on the following lines of code:

andrewlimaza commented 1 year ago

Thinking about production, we could add in a filter to make it easily extendible. However, I'm more concerned about how to handle draft lessons on a published course as it will show up under the course on the frontend and show a 404 error.

We could hide the draft lesson from the frontend or show it but hide the link. We need more input around expected behavior for these cases as it may happen and may not be ultimately clear to admins/site owners.

Summary of my thoughts: