This is a biggy. Lots of stuff going on here. There were no major bug fixes in this one, so you don’t have to update unless you want to take advantage of the new features. I’ll be going into a few of the individual updates in more detail in later posts.
- Rewrote the
pmpro_login_redirectfunction. It’s cleaner now. Important: there was a pmpro_login_redirect hook in there that was fairly redundant with the core
login_redirecthook. I’ve renamed the pmpro hook to pmpro_login_redirect_to because I had a hook with the same name (pmpro_login_redirect) used in a different place to control whether or not PMPro redirects the register page to the levels page. Having one hook for two things is a bad idea. It seems like more people were using the hook for controlling the registration redirect, so I left that one alone and renamed these.
- Changed PMPro page creation to set all membership pages as subpages of the membership account page. This results in nicer menus for themes that add all top level pages to the menu.
- Updated the checkout page to submit to “” (itself) instead of echoing the checkout page URL here. (Since we can have multiple checkout pages.) This also fixes from SSL conflicts that may crop up on the checkout page.
- Updated the priority of a few actions/hooks so the “besecure” https stuff gets run as soon as possible. Before it was possible that some URLs could be written out with http: on an HTTPS page before PMPro had a chance to fix things. You should have fewer SSL errors on the checkout page to deal with now.
- Added an option on the payment settings page to “nuke” http: links on all secure pages. This option can add time to your page loads, but will ensure that all http: links for your domain are replaced with https: links.
- Allowing multiple pages to use the Membership Checkout shortcode or block so you can create multiple checkout pages. This is good if you want a separate templated checkout page for each membership level or product you have.
- You can now add a pmpro_default_level custom field, set to the id # of the level you want, that will be used if you navigate directly to a checkout page without setting a level.
- Added some stuff to support adding shipping fields via hooks.
- Removed the price from the description sent to PayPal. The DESC field is limited to 127 characters and must match up across API calls. So there is a good chance the price would get truncated which could be confusing. This was a kind of hack anyway. PayPal should show the price data it has. Not sure why it won’t. The price is still reviewed on the review page of your site though.
- The recaptcha code now checks for a previous error before changing pmpro_msg to “All Good”.
- Fixed warning in
pmpro_has_membership_access(). Fixed a bunch of other warnings here and there.
pmpro_updateMembershipCategories()just to be cleaner
pmpro_state_dropdownsfilter. If you return true, the state field will become a dropdown with US states. Use the pmpro_states and pmpro_states_abbreviations filters to change the array of states used.