Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kimwhite/e7cc4182a3e21f62966661e4c97c6c18 to your computer and use it in GitHub Desktop.
Save kimwhite/e7cc4182a3e21f62966661e4c97c6c18 to your computer and use it in GitHub Desktop.
Glue code for PMPro Add On Packages and PMPro bbPress. Allows you to sell access to individual forums by using the PMPro Add On Packages
<?php // do not copy this line.
/**
* This recipe Allows you to sell access to individual forums by using the PMPro Add On Packages
* Please test and make sure this meets your needs.
*
* 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_pmproap_supported_post_types($post_types)
{
$post_types[] = 'forum';
return $post_types;
}
add_filter('pmproap_supported_post_types', 'my_pmproap_supported_post_types');
function my_bbp_template_include_theme_compat($template)
{
bbp_restore_all_filters('the_content');
$template = bbp_get_theme_compat_templates();
return $template;
}
function my_init()
{
remove_action( 'template_redirect', 'pmprobbp_check_forum' );
}
add_action('init', 'my_init');
add_filter('bbp_template_include_theme_compat', 'my_bbp_template_include_theme_compat');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment