Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not show the Course Media and Lesson Media sections for user not taking course #42

Merged
merged 2 commits into from Mar 18, 2019

Conversation

Projects
None yet
2 participants
@alexsanford
Copy link
Contributor

commented Mar 18, 2019

Fixes #41

Also adds filter sensei_media_attachments_show_media_links to override whether the media attachment links should be shown.

Note that the media may still be accessible to anyone via a direct link. However, the links are no longer visible on the Course and Lesson pages.

One point to discuss: this PR only checks to see if the user has started the course. However, in some cases course and lesson content should be shown to users who have not started the course as well. Currently this PR does not take that into consideration, which means that media attachment links will not show up for these users, even if the rest of the content is being displayed.

Hooks

  • sensei_media_attachments_show_media_links: classes/class-sensei-media-attachments.php line 194

@alexsanford alexsanford self-assigned this Mar 18, 2019

@alexsanford alexsanford requested review from jom and donnapep Mar 18, 2019

@alexsanford alexsanford changed the title [WIP] Do not show the Course Media and Lesson Media sections for user not taking course Do not show the Course Media and Lesson Media sections for user not taking course Mar 18, 2019

@donnapep

This comment has been minimized.

Copy link
Contributor

commented Mar 18, 2019

One point to discuss: this PR only checks to see if the user has started the course. However, in some cases course and lesson content should be shown to users who have not started the course as well.

What are these cases of which you speak? 🙂

@donnapep donnapep added this to the 2.0.0 milestone Mar 18, 2019

@alexsanford

This comment has been minimized.

Copy link
Contributor Author

commented Mar 18, 2019

What are these cases of which you speak? 🙂

Well, when the "Access Permissions" checkbox is unchecked, then anyone can view lesson content (https://cld.wthms.co/H1G5uG). Similarly, if the lesson is set as a "preview" lesson. I'm not sure whether there are similar cases for seeing the course content?

@donnapep

This comment has been minimized.

Copy link
Contributor

commented Mar 18, 2019

Good points. I think this is good enough for now though, especially since we're adding a hook they can use if they don't like the default behaviour.

@donnapep
Copy link
Contributor

left a comment

👍

@alexsanford alexsanford merged commit ef3acd7 into master Mar 18, 2019

@donnapep donnapep deleted the fix/hide-media-for-user-not-in-course branch Mar 18, 2019

alexsanford added a commit that referenced this pull request Mar 27, 2019

Merge pull request #42 from woocommerce/fix/hide-media-for-user-not-i…
…n-course

Do not show the Course Media and Lesson Media sections for user not taking course

@donnapep donnapep modified the milestones: 2.0.0, 1.0.2 Mar 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.