Skip to content

Instantly share code, notes, and snippets.

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 JarrydLong/7e37050038b011490fd30fdc9479782e to your computer and use it in GitHub Desktop.
Save JarrydLong/7e37050038b011490fd30fdc9479782e to your computer and use it in GitHub Desktop.
<?php //do not copy
/**
* This recipe will remove the query that filters users from the directory when using
* the Approvals Add On.
*
* 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 mypmpro_remove_approvals_query() {
remove_filter( 'pmpro_member_directory_sql_parts', array( 'PMPro_Approvals', 'pmpro_member_directory_sql_parts'), 10, 9 );
}
add_action( 'init', 'mypmpro_remove_approvals_query' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment