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

demo

Using Anonymous Functions for Filters and Actions

Chad Butler · Nov 12, 2018 · Leave a Comment

This article is provided free. Find out how you can get full access to premium content, including how-to articles and support forums, as well as priority email support and member exclusive plugin extensions..

 

The more customization that you do when building a WordPress site, the more you will find that you have a lot of functions hooked to actions and filters.  Sometimes these functions might be quite simple, returning just a single line of text or replacing a single word.  Is there an easy way to make this more compact?

Yes, there is!  Here’s how:  Continue Reading →

Add current password confirmation to change password form

Chad Butler · Dec 30, 2014 ·

Recently, a question came up about adding an additional field to the change password form for the user to confirm their current password as a requirement of changing the password.

Adding the extra field is very easy with a filter.  The trickier part is to handle validating the new form input and providing an error message.  But this example will show you a reasonable approach to doing that.  Continue Reading →

Reset password with just email

Chad Butler · Jan 27, 2014 ·

NOTE: if you are using version 2.9+, there is a new set of code snippets using some new filter hooks that make this process easier.

One of the requests I get most often is how can I change the plugin to have the password reset only require the user to give their email address.  This especially comes up when people customize the process to use the person’s email address as their username, since a password reset form with “username” and “email” doesn’t make much sense in that situation.

Well, since version 2.8.5, there has been a filter hook in the password reset process that allows you to filter the arguments that are passed in order to reset the user’s password – wpmem_pwdreset_args.  There are two stages to this demonstration, and thus two parts of the code snippet.  First, we only need a form requesting the user’s email, so we will remove the “username” field from the form.  Second is filtering the arguments of the password reset process so that the user’s password can be reset with only the email provided. Continue Reading →

Use an invitation code with the PayPal subscription extension

Chad Butler · Jan 14, 2014 ·

When running the PayPal subscription extension, you might have some users you want to give a free account to. Or you might want to offer a discount to users with a specific code.  Here is are some code snippets that will allow you to validate a promotion code in the registration form and if it is valid, either bypass the PayPal process (for a free subscription) or apply a discount.  Continue Reading →

Creating menus for different user roles

Chad Butler · Jan 13, 2014 ·

We’ve had some different tutorials on displaying menus based on login status – showing a different menu for logged in users vs. non-users.  I also put together a code snippet and a plugin extension to automate this process.  There’s even a tutorial on how to remove menu items based on login status.

This tutorial is an extension of those concepts to display different menus based not only on logged in status, but also a user’s role.  Continue Reading →

  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Go to Next Page »

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