• Skip to primary navigation
  • Skip to main content

RocketGeek

Home of WP-Members, The Original WordPress Membership Plugin

  • WordPress Plugins
    • WP-Members
      • FAQs
      • Quick Start
      • Documentation
      • Extensions
    • Advanced Options
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Download Protect
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Invite Codes
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • MailChimp Integration
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • PayPal Subscriptions
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Salesforce Web-to-Lead
    • Security
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Text Editor
      • Purchase the Plugin
      • Get the Pro Bundle
    • User List
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • User Tracking
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Memberships for WooCommerce
    • WordPass
  • Blog
    • Basics
    • Tips and Tricks
    • Filters
    • Actions
    • Code Snippets
    • Shortcodes
    • Design
    • Release Announcements
  • Store
    • Cart
    • Checkout
  • Contact
  • Log In
  • Show Search
Hide Search
Home » Archives for wpmem_register_data

wpmem_register_data

Generate Random User Display Name and Nickname

Chad Butler · Nov 17, 2015 ·

One thing I love about WP-Members is how versatile it is. Because of this it gets used in many applications that I did not really envision when I first released it in 2006.  Recently, I had a support user ask about something that I am surprised has not come up before involving using alternate display names and/or nicknames for users because the user base is made up of minors (children).

This made total sense to me and I understand the needs of sites that have to protect identities of users, especially minors.  In this particular case, the suggestion was made to create random values for the user’s display name and nickname that was used on the site.

Here is a set of scripts that will allow you to generate random display names for users.  The given example uses colors and numbers creating results such as red22 or blue99, but this can be adapted to use as many different words as you would like and can also use more than two digits.  It tests for name uniqueness, not allowing duplicate results, and also includes scripts for allowing users to update their name as long as it remains unique.  Continue Reading →

Multiple Selection Checkboxes

Chad Butler · Apr 22, 2014 ·

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.  Continue Reading →

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

Chad Butler · Mar 27, 2014 ·

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.  Continue Reading →

Multiple Selection Checkboxes

Chad Butler · Oct 15, 2013 ·

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.
Note that there is now a more flexible example of multiple selection checkboxes here. This example is easier to set up and allows for multiple checkbox groups.

Something that will probably become a full feature in the main plugin is multiple selection checkboxes. However, until that becomes a full feature, here is a code snippet that you can use to set this up in your existing installation.

Continue Reading →

Adding the WP display_name field to the WP-Members user profile update form

Chad Butler · Jul 10, 2013 ·

Recent versions of the plugin have improved support for some of the WP native fields such as nickname, user_nicename, and display_name.  I will be continuing to improve support for these fields.  Currently, if you want to add something like the Display Name field to the front end of the plugin, you need a little customization.  This post will take you through adding that to the front-end user profile update.

This needs to be done in the user profile update and not at registration because WP bases these fields on data used in registration that is not available on the static form – the nickname, the username, and first/last name.  This tutorial focuses on adding it to the user profile update, much like WP’s backend (which doesn’t set this at registration, either). Continue Reading →

Ready to get started?

Join Today!

© 2025 · butlerblog.com · RocketGeek is built using WordPress, WP-Members, and the Genesis Framework

  • butlerblog.com
  • WP-Members Support Subscription
  • Terms of Service
  • Privacy Policy
  • Refund Policy