WP-Members 3.1.8 is complete and is now available for upgrading.
Here is what’s in store for you in this new release:
New Fields Tab
This release rebuilds the form fields tab to manage registration/profile fields. On a technical level, it was rebuilt to utilize WP’s list table class, so the table and bulk menu for deletion/saving settings should look familiar as this is used in many other places throughout the WP admin area. The drag-and-drop handling was completely redone and now utilizes a jQuery library packaged with WordPress.
I’ve already noticed a couple of minor elements that I want to continue to improve, but you should notice an improvement in how the interface handles editing existing fields – the process now leaves you on the same screen when you make an update rather than taking you back to the main field table. This change was something requested by several users and I think it operates much better now.
You may also notice that you can now edit all fields. In previous versions you could not change the field labels for WP native fields. But I’ve changed that as the labels don’t really matter to how the field is handled, and as long as the meta key remains consistent, the display label can be changed to whatever is desired.
A confirmation screen has also been added when deleting fields.
Admin Panel Support for New Field Types and Attributes
Along with the Fields Tab rebuild, this release adds support in the admin panel for the number and date field types that were added in 3.1.7. You can now add these types of fields in the admin panel. This brings the total of support field types to 14.
Additional HTML5 form attributes were added to the admin panel as well. Now you can add placeholder, pattern (regular expression or “regex”), and title attributes to supported field types. There is also support for the min and max attributes for numbers and dates.
Text Area Field Line Breaks
This version also addresses line breaks in the text area field type. Previously, line breaks could potentially get stripped out. If the user profile was not updated, the line breaks would remain in the database, but would not be displayed. If the profile was updates, they would be stripped at that point.
The problem was due to a process in the form function that stripped all line breaks from the form HTML. This is a process that was intended to avoid the extra <p> and <br> tags that WordPress would apply using the wpautop() function that is used to format content.
I’ve updated the processing to still strip out the line break in the HTML, but if a text area field is used, it will reapply the line breaks to that field before display.
Additionally, the display of a text area field using the [wpmem_field] shortcode would likewise remove line breaks. This has been addressed in the 3.1.8 release as well.
The previous release (3.1.7) came out the same time as WooCommerce 3.0. Unfortunately, in the crossover, I missed the fact that WooCommerce removed a major WordPress action hook from their default registration form template – register_form.
The removal of this action hook means that any WP-Members custom fields are not applied to the WC registration form by default.
In previous versions of WooCommerce (2.x), the form used by the WP register_form action as well as the WC woocommerce_register_form action. Since there have been many users using WP-Members with WooCommerce, WC has broad distribution and adoption, and Automattic is now the team behind WooCommerce, I have been working to better integrate WP-Members with WooCommerce. So this release not only addresses the change in the action hook, but also takes that opportunity to apply a specific function for WooCommerce registration rather than just applying the function for the native WP registration (which was previously the case). This will lead to hopefully better integration across both WC and WP and a more streamlined process.
The old wpmem_do_sc_pages() function has been deprecated. It will still exist in the deprecated functions file in case some users still maintain the [wp-members] shortcode tag. The final function that had been using it was the wpmem_sc_user_profile() function for the user profile. This function acted as a wrapper but still ultimately used the old function. I’ve updated wpmem_sc_user_profile() to stand alone in this version so that the older function can now be deprecated. The side benefit is that the new function is much more streamlined because it does not need to account for any of the old, unsupported shortcode tags.
There were some improvements in the user profile shortcode as well to only display logged in content (using the [wpmem_logged_in] shortcode) on the user profile page if the “wpmem_a” (the main action variable) is not set. In layman’s terms, this means that if you use [wpmem_logged_in] on the user profile page ([wpmem_profile]), the logged in content will not be displayed when the page is executing an action such as profile update, password change, etc. It will only display when the page is in the “links” state.
This version includes some updates for better multisite support. Previously, there were some issues because the “admin” role and “super admin” are not the same. In some situations, the super admin may be relying on “admin” users with reduced permissions. This caused a problem with a couple of specific required capabilities for the WP-Members admin. This has been changed so that the multisite “admin” role can handle WP-Members administration. The required roles for these dependencies are now filterable so should they need to be removed/changed, that is a possibility as well.
The “register” link in the login form was addressed to not display in situations where the login form and registration form are displayed together. In the plugin’s default configuration, this would be on all blocked content and also on the user profile page. The register link will now only display on the login form when it is shown alone (no register form on the page). Note: this does not apply to the sidebar/widget login, and also does not apply if the two forms are displayed on the same page by shortcode (i.e. [wpmem_form login] and [wpmem_form register]) as those are separate instances of the form(s).
File and image field updates are now possible from the admin/dashboard user profile.
Overall, the code for the Fields tab underwent some improvements to modernize and streamline the code.