Skip to content

Instantly share code, notes, and snippets.

@ideadude
Last active April 3, 2021 04:07
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 ideadude/1d17a6811ce41efe118075db8cc1fb2d to your computer and use it in GitHub Desktop.
Save ideadude/1d17a6811ce41efe118075db8cc1fb2d to your computer and use it in GitHub Desktop.
Tell PMPro to look for templates in this plugin's templates/ folder.
<?php
/**
* Tell PMPro to look for templates in this plugin's templates/ folder.
*/
function my_pmpro_pages_custom_template_path( $templates, $page_name ) {
$templates[] = plugin_dir_path(__FILE__) . 'templates/' . $page_name . '.php';
return $templates;
}
add_filter( 'pmpro_pages_custom_template_path', 'my_pmpro_pages_custom_template_path', 10, 2 );
@laurenhagan0306
Copy link

This recipe is included in the blog post on "How to Load a Custom Template for Membership Pages or System-Generated Emails" at Paid Memberships Pro here: https://www.paidmembershipspro.com/new-method-load-custom-templates-pmpro-generated-pages-system-generated-emails/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment