WP-Members 3.1.7 will be released Monday evening, April 3. There are some great improvements in the plugin that I am excited about, but if you are an existing user, there are some significant changes you should be aware of before blindly updating.
Note that there are no database changes updating to 3.1.7 from any flavor of 3.1. So you can roll back to the previous version if necessary.
Important Changes to Behavior
In light of the fact that there are many many more plugins that are hooking into the WP login process for adding things to the form such as CAPTCHAs, I have added the do_login action to the WP-Members login form building function. That means that anything hooked to do_login will now fire with the WP-Members login form.
That is a significant change from previous versions. Does it affect you? The answer is, it depends.
An additional change to the WP-Members login is the addition of support for WP’s login_redirect hook. I’ve had a lot of people ask questions when either trying to use it specifically or when integrating with another plugin that uses it. It was not supported originally because it did not exist when WP-Members was first launched. And up until recently, it didn’t seem necessary to add. However, I’m getting more and more questions in this area so adding it should alleviate many of those.
The addition of login_redirect comes BEFORE wpmem_login_redirect. If you do not use login_redirect for anything, then your existing filters are unaffected. If you use login_redirect AND wpmem_login_redirect for various different things, then the login_redirect will take priority. (NOTE: I may change this depending on user feedback. I don’t foresee any issues here, but then I have a user base that comes up with ways to use the plugin that I never thought of, so some of you may have feedback on this.)
Changes to Texturization Process
WordPress has some functions that it runs in order to add HTML paragraph and line break tags to content. When the plugin was first released, this was a problem because WP’s filtering viewed the line breaks in the form HTML as needing these tags. This messed up the form layout significantly. In order to handle this, I came up with a way to remove the WP process but only when WP-Members’ forms were being displayed.
Since that time, there have been many advances and changes in the way themes use content and the way these WP filters/functions get applied. So in some cases, this has led to challenges where the WP-Members process has not merged well into the theme process. The two issues have been paragraph tags being added where not desired and unparsed shortcode (the custom shortcode WP-Members puts around its forms to apply the aforementioned change).
It appears that in a great many cases, the filters that WP-Members is applying to its forms for this are no longer necessary in the majority of cases. So in 3.1.7 I am changing from defaulting to use this process, to making it optional.
Does this affect you? After updating, take a look at your forms. If they look different (and spaced out), look at the HTML in the browser’s inspector. If there are HTML paragraph (<p>) tags in the registration or login form HTML, then this change does affect you. I’ll be posting a code snippet for turning this filter back on.
The above two items are the most significant changes in terms of updating smoothly. Everything else is a functional improvement or new feature.
There are three new shortcodes:
There are three new API functions and two updated:
- wpmem_is_user_activated() – New
- wpmem_current_post_id() – New
- wpmem_form_label() – New
- wpmem_is_reg_page() – default is now the current page ID, can accept a page ID, returns true/false
- wpmem_current_url() – now checks for query string (so mysite.com and mysite.com/?something=other are actually different)
New and Updates Filter and Action Hooks:
- Filter: wpmem_fields – filters the fields retrieved by wpmem_fields(). Makes it easier to customize fields for display on different pages, forms, etc.
- Action: wpmem_get_action – fires when the wpmem_a variable is loaded.
Output and Layout:
- Successful registration message now shows on register redirect if nonce validates (no message showed on a redirect previously).
- Corrected issue where RS Captcha did not have a div wrapper (now has a div wrapper to match other fields).
- Added div wrapper to post restricted message (in most cases this wasn’t a problem; however, in use with some page builders that leave out page structural markup, this gives an extra wrapper to apply CSS to for improved layout handling).
- HTML 5 support added for input, min, max, title, and pattern attributes. (These have not been added to the admin Fields tab yet, but support is there in the fields object to customize as needed. I’ll add to the admin panel in the next release.)