Forked from strangerstudios/my_pmpro_pages_custom_template_path.php
Last active
January 7, 2020 16:16
-
-
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.
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 | |
/* | |
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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is an update to this recipe here: https://gist.github.com/ideadude/1d17a6811ce41efe118075db8cc1fb2d