Created
October 9, 2019 19:08
-
-
Save ideadude/99a5838b602279c4631272be70943b8b to your computer and use it in GitHub Desktop.
Load the PMPro Stripe Library Earlier
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
| /** | |
| * Load the PMPro Stripe Library Earlier | |
| * Works with PMPro v2.1+ | |
| * Use this if you are experiencing errors like Stripe/PaymentMethod not found | |
| * or other errors that might be caused by another Stripe Library loading earlier. | |
| * | |
| * This is not meant as a final solution. | |
| * With this coded enabled, you may notice other Stripe-related plugins breaking. | |
| * When you find the other plugin that is affecting things, you can see if | |
| * that plugin is needed or if there is an update. | |
| * Or you can use more specific code to make sure that that plugin doesn't load | |
| * their older version of the Stripe API on the PMPro checkout and update billing pages. | |
| */ | |
| function my_load_pmpro_stripe_library_early() { | |
| if ( defined( 'PMPRO_DIR' ) && function_exists( 'pmpro_is_checkout' ) && pmpro_is_checkout() ) { | |
| require_once( PMPRO_DIR . "/includes/lib/Stripe/init.php" ); | |
| } | |
| } | |
| add_action( 'init', 'my_load_pmpro_stripe_library_early', 0 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment