Multiple Selection Checkboxes

As of WP-Members 3.1.0, multiple selection checkbox support is an included feature in the plugin. That makes custom implementation such as described here unnecessary for most applications. I am leaving this post here however as there may continue to be users who (1) need a high level of customization that may utilize some or all of this kind of approach, and (2) for users who may not update to 3.1+ who need this support.

multi-check.fwWith the new wpmem_register_form_rows filter hook introduced in 2.9, the process of dealing with multiple selection checkboxes becomes far less complicated than previously.

The previous method involved adding each checkbox as a field, and then all of the extra code we needed to handle multiple fields as one both for storing the data, handling user updates, and also in emailing admin notifications.

But 2.9 allows us to filter the rows directly in the array of rows and insert the extra html we need for this. That means you only need to create one field in the fields manager which makes handling the data much easier on the backend.  I’ve even made the code snippets nearly cut-and-paste.  In most cases, you should only need to specify the name for the checkbox group and the labels/checked values. 

This article is only available to WP-Members Support Subscribers. If you have an existing subscription, please login below. If you do not have a current support subscription, you can purchase a support subscription here.

Existing Users Log In
   
New User Registration
*Required field