Last active
March 14, 2022 18:26
-
-
Save dparker1005/84159bb9d2a6c13b7443bfa161f1c23e to your computer and use it in GitHub Desktop.
Make sure that the MemberInvoice class is loaded when using MMPU.
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 | |
| // Copy from below here... | |
| /** | |
| * Make sure that the MemberInvoice class is loaded when using MMPU. | |
| * | |
| * 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_ensure_MemberInvoice_loaded() { | |
| if ( ! class_exists( 'MemberInvoice' ) && defined( 'PMPROMMPU_DIR' ) && file_exists( PMPROMMPU_DIR . '/includes/invoice.php' ) ) { | |
| require PMPROMMPU_DIR . '/includes/invoice.php'; | |
| } | |
| } | |
| add_action( 'init', 'my_pmpro_ensure_MemberInvoice_loaded' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment