strangerstudios / pmpro-addon-packages

Charge for access to specific pages or other post types in WordPress. Requires the Paid Memberships Pro plugin.
https://www.paidmembershipspro.com/add-ons/pmpro-purchase-access-to-a-single-page/
25 stars 29 forks source link

Cleaning up nested functions #56

Closed dparker1005 closed 1 year ago

dparker1005 commented 1 year ago

The pmproap_pmpro_checkout_level() function currently contains a lot of nested functions that it hooks as needed: https://github.com/strangerstudios/pmpro-addon-packages/blob/7d022caffc222bdb3ea762295818d321c7fd499b/pmpro-addon-packages.php#L422-L541

This approach is not working with Stripe Checkout and is not how we recommend hooking into our checkout process in general. This PR pulls out those nested functions to standardize the code and make it easier to work with in the future.