• 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_pre_update_data

wpmem_pre_update_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 →

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 →

Email Admin When a User Updates Registration Data

Chad Butler · Apr 26, 2013 ·

Here’s a request I get from time to time – how can the admin receive email notification that a user updated their data, so I figured it is about time to put that together as a tutorial.

This one should be fairly straight forward and can be used cut-and-paste for the general features.  As usual, I’ve tried to comment the code so that you know what is happening where and more advanced users can build on this concept from there.  Continue Reading →

Custom form field validation: numeric fields

Chad Butler · Mar 14, 2013 ·

WP-Members has its own built-in form field validation for things like usernames, email, and required fields.  But what if you need to validate other elements, such as testing to see if an entered value is a number?  Yes, the plugin framework allows for you to extend the form field validation to whatever you need.

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