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 ideadude/5758d48d5768876313a316ff4873b620 to your computer and use it in GitHub Desktop.
Save ideadude/5758d48d5768876313a316ff4873b620 to your computer and use it in GitHub Desktop.
Tell PMPro to look in the pages folder of this plugin for PMPro page templates.
<?php
/*
Tell PMPro to look in the pages directory of this plugin for PMPro page templates.
Add this code to a custom plugin.
Make sure that there is a /pages/ directory in the plugin directory with your templates in it.
*/
function my_pmpro_pages_custom_template_path( $default_templates, $page_name, $type, $where, $ext ) {
$default_templates[] = dirname(__FILE__) . '/pages/' . $page_name . '.' . $ext;
return $default_templates;
}
add_filter( 'pmpro_pages_custom_template_path', 'my_pmpro_pages_custom_template_path', 10, 5 );
@kimcoleman
Copy link

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