Created
June 25, 2020 19:09
-
-
Save kimcoleman/2a246ea1f46f0094ed89498b963f7a34 to your computer and use it in GitHub Desktop.
Hide the 'qpm_form' post type from searches and archives if membership is required to access.
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 the 'qpm_form' post type from searches and archives if membership is required to access. | |
* | |
* 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 hide_qpm_form_filter_post_types( $post_types ) { | |
$post_types[] = 'qpm_form'; | |
return $post_types; | |
} | |
add_filter( 'pmpro_search_filter_post_types', 'hide_qpm_form_filter_post_types' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment