Created
July 5, 2021 21:36
-
-
Save kimcoleman/bf5d55c385b2e69f9b91189c71f49047 to your computer and use it in GitHub Desktop.
Include Lessons in search results using the default module in the Courses for Membership Add On for Paid Memberships Pro.
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 | |
| /** | |
| * Include Lessons in search results using the default module in the Courses for Membership Add On for Paid Memberships Pro. | |
| * | |
| * You can add this recipe to your site by creating a custom plugin | |
| * or using the Code Snippets plugin available for free in the WordPress repository. | |
| * | |
| */ | |
| function include_pmpro_courses_lessons_in_search($args, $post_type) { | |
| if ( $post_type == 'pmpro_lesson' ){ | |
| $args['exclude_from_search'] = false; | |
| } | |
| return $args; | |
| } | |
| add_filter('register_post_type_args', 'include_pmpro_courses_lessons_in_search', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment