Add a Date of Birth Field with Dropdown Selections for Month, Day, and Year

I have received a lot of requests in the past for how to add a set of dropdown selections for date and store it as a single user meta value. This is a great example of using the new wpmem_register_form_rows filter hook, a new hook in 2.9, because we can use a single field in the WP-Members Fields tab for the date of birth to be stored as a single meta and use the filter to quickly change the placeholder field to a trio of dropdowns for date selection.

Note: this example requires a some php work, but like all of the examples here, I have tried to make it as “cut-and-paste ready” as I can.  For many, this will work out of the box.  For some, you may want to change the way the date is assembled and displayed (i.e. DD/MM/YYYY). I’ve tried to comment the code snippet as much as possible so you can follow what is going on.  

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