Created
April 2, 2024 13:33
-
-
Save dparker1005/c7fa84e77499720257c425314425d628 to your computer and use it in GitHub Desktop.
Use the default PMPro checkout page template instead of a custom theme tempalate.
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 | |
/** | |
* Use the default PMPro checkout page template instead of a custom theme tempalate. | |
* | |
* 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_pmpro_checkout_custom_template_path_use_default( $default_templates, $page_name, $type, $where, $ext ) { | |
// Add a custom template path for the checkout page. | |
$default_templates[] = PMPRO_DIR . "/{$type}/{$page_name}.{$ext}"; | |
return $default_templates; | |
} | |
add_filter( 'pmpro_pages_custom_template_path', 'my_pmpro_checkout_custom_template_path_use_default', 10, 5 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment