Skip to content

Instantly share code, notes, and snippets.

@kimcoleman
Created November 27, 2018 12:44
Show Gist options
  • Save kimcoleman/02f42ed72dc874bced9131e36ca31435 to your computer and use it in GitHub Desktop.
Save kimcoleman/02f42ed72dc874bced9131e36ca31435 to your computer and use it in GitHub Desktop.
Filter the pmpro_pages_custom_template_path later to add our custom file for checkout.php.
<?php
/*
* Filter the pmpro_pages_custom_template_path later to add our custom file for checkout.php.
*
*/
function pmpro_custom_override_checkout_page( $templates, $page_name, $type, $where, $ext ) {
if ( ( $page_name === 'checkout' ) && file_exists( dirname(__FILE__) . '/pmpro-multiple-memberships-per-user/checkout.php' ) ) {
array_splice( $templates, 1, 0, dirname(__FILE__) . '/pmpro-multiple-memberships-per-user/checkout.php' );
}
return $templates;
}
add_filter( 'pmpro_pages_custom_template_path', 'pmpro_custom_override_checkout_page', 10, 5 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment