A new year, and a fresh upgrade for WP-Members! Version 3.2.5 is a feature release with some fixes.
First, let’s talk about what was fixed in this release. Most of these were fairly minor and only manifested themselves is specific occurrences, but I’m still happy about getting them addressed.
- Fixed issue with the default ToS (terms of service) field not displaying properly in the dashboard/admin user profile views.
- Fixed issue with [wpmem_logged_in] handling the “product” attribute to restrict content based on specific membership products.
- Fixed issue with [wpmem_field] shortcode to check if the requested field is set to avoid triggering an undefined index error in PHP.
- Fixed issue with the do_excerpt() function if the $post object is not set as an object.
- Fixed issue with logic displaying hidden posts based on a user’s membership product access.
Now, let’s talk about the good stuff – new features!
- Added message dialog to display in Customizer (more detail below).
- Added an HTML5 “required” attribute for the TOS checkbox if it is marked as required.
- Added redirect_to attribut for logout link.
- Added the HTML id attribute as a custom parameter in the wpmem_register_form_args filter.
- Added $tag parameter to wpmem_{$tag}_link and wpmem_{$tag}_link_str filters. This way, it passes the $tag being triggered of you have a filter that may be consolidated to run on several filter hooks.
- Added a wpmem_email_send_args filter – this allows filtering the wp_mail() arguments just before wp_mail() is triggered.
- Added a wpmem_is_user() utility to the API. This can be used to verify that a user is actually a user.
- Added wpmem_do_shortcode() utility (more detail on this below).
- Added wpmem_export_fields filter to the export function to customize exports.
- Added jQuery User Profile tabs (more on this below).
Updates:
- Updated the wpmem_form_date() function.
- Updated the product access verification to make sure to handle the product as an array (so that it can check single products or multiple products). This helps fix some issues with the shortcode fixed in the list above.
- Updated the registration form to pass and verify a nonce. This existed in previous versions but as a customizable option. It is now the default. This should prevent the registration function from being triggered unless the nonce verifies.
- Updated form field creation so that a $value is now optional.
- Removed reCAPTCHA version 1 entirely as it is obsolete.
- Removed the widget status message “you are not logged in”. This tidies up the login widget (if people see the login form, I think they already know they are not logged in, right?).
Message Dialog in Customizer
In a previous release, I added controls in the WordPress Customizer so that the login and registration forms could be viewed while in a logged in state (since you have to be logged in to use the Customizer). This allows you to do custom CSS work on the form while in the Customizer and then apply custom CSS using the Customizer’s custom CSS options.
In WP-Members 3.2.5, I have expanded this functionality to also display the WP-Members dialog message (such as registration form errors and success messages) so that you can also customize that CSS easier.
See the documentation on using the Customizer.
wpmem_do_shortcode() Utility
I see so many people use do_shortcode() to run a single shortcode from within a template or other method, and this simply is a bad practice. It puts an unnecessary load on your processing that you probably are not even aware of. A much better method exists of running the shortcode’s callback function directly. But what if that callback exists in an object class? J.D. Grimes at codesymphony.com has a great utility for handling this. Because I see people run WP-Members’ shortcodes all the time using the do_shortcode() method, I’ve incorporated JD’s utility into the WP-Members API as wpmem_do_shortcode(). Using this will allow you to run the shortcode callback directly without using do_shortcode() which runs the entire regex of shortcodes in memory.
jQuery User Profile Tabs
I’ve added jQuery Tabs to the dashboard side (admin) user profile. For now, this is intended for customization and other uses, but as it progresses in further versions I may incorporate the full set of extra fields into the process. It will serve to tidy up the dashboard profile view when there are extra tables displayed (such as downloads from Download Protect, or user page visits from the User Tracking extension). It has a set of filters so custom tabs can easily be written for whatever custom user data you want to display in your admin user profile view.
I’ll be writing more on this with examples, and some of the extensions are going to have updates released in the coming days and weeks that incorporate this update.