Last active
December 5, 2025 13:51
-
-
Save davidmutero/addc6d48f7d236f3e33b39669c3c133a to your computer and use it in GitHub Desktop.
Hide Course Overview from Non-Members Using the Default Courses Add On Module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Hide course overview from non-members | |
| * when using the Default Courses Add On for Paid Memberships Pro. | |
| * | |
| * This prevents non-members from viewing detailed course content blocks | |
| * such as Lesson Overview, Course Description, Requirements, etc. | |
| * | |
| * Add this recipe to your PMPro Customizations Plugin or use the | |
| * Code Snippets plugin. | |
| * | |
| * https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| /** | |
| * Returning false prevents the Overview section from being displayed | |
| * unless the viewer has access to the course via membership. | |
| */ | |
| add_filter( 'pmpro_courses_show_course_content_to_nonmembers', '__return_false' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment