Skip to content

Instantly share code, notes, and snippets.

@dparker1005
Last active February 23, 2024 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dparker1005/fe1fb6c69a9f60c34e927985b82e84eb to your computer and use it in GitHub Desktop.
Save dparker1005/fe1fb6c69a9f60c34e927985b82e84eb to your computer and use it in GitHub Desktop.
Disable hiding PMPro pages from search.
<?php
/**
* Disable hiding PMPro pages from search.
*
* 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/
*/
/**
* Disable hiding PMPro pages from search.
*/
function my_remove_pmpro_search_filter_pmpro_pages() {
remove_filter( 'pre_get_posts', 'pmpro_search_filter_pmpro_pages' );
}
add_action( 'init', 'my_remove_pmpro_search_filter_pmpro_pages', 9 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment