Created
July 21, 2026 10:29
-
-
Save dwanjuki/b59bc519294396ce95c46192ecfb87fa to your computer and use it in GitHub Desktop.
Keep PMPro downloads visible in searches/archives/library even when "Filter Searches and Archives" is set to Yes.
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 | |
| /** | |
| * Keep PMPro downloads visible in searches/archives/library | |
| * even when "Filter Searches and Archives" is set to Yes. | |
| * | |
| * The files remain protected. | |
| * | |
| * 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. | |
| * Read this companion article for step-by-step directions on either method. | |
| * https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmpro_downloads_show_in_searches_and_archives() { | |
| remove_filter( 'pmpro_search_filter_post_types', 'pmpro_downloads_search_filter_post_types' ); | |
| } | |
| add_action( 'init', 'my_pmpro_downloads_show_in_searches_and_archives', 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment