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

hooks

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 →

Do not modify plugin files

Chad Butler · May 3, 2015 ·

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..

 

This is an important best practice – never, ever modify plugin files directly.

Rule 1: there is never a good reason to do this.

Rule 2: refer to rule 1.

Continue Reading →

A random word and number combination for passwords

Chad Butler · Jan 22, 2014 ·

One of the earliest code snippets provided on this site was one that discussed how to create an easier random password.  This post discussed two examples: one that showed how to create a random password of only upper and lower case letters and one that always set a specific word.

I understand that some sites have users that are not very computer savvy, and I often get the question of how does one generate a random password that is both secure and easy to use.  So, I came up with this little example.

This code snippet will generate a password that is a combination of a random word and a random 2 digit number.  This allows you to generate random passwords that will be easier on the user and still have some level of security.  Continue Reading →

Add a sortable date user registered column to the Users > All Users page

Chad Butler · Dec 4, 2013 ·

If you manage a site that has a lot of registrations, sometimes it is helpful to show the date the user registered as a custom column in the WordPress admin page Users > All Users.  I have shown in another post how you can add that data as well as other data to this table.

But what if you want to make it sortable so you can sort the table by the date the user registered to see what users have registered most recently?  Here is a way that you can do that.  Continue Reading →

Create different styles for “success” and “error” messages

Chad Butler · Jan 4, 2013 ·

This is an idea that has been floated by a few users, which means there is probably a need for it.  As is usually the case, I don’t like to make wholesale changes to the codebase that effects users in a way that requires them to make a change to accommodate an update.  So I wouldn’t want to change the plugin to put in different classes, since users with a custom stylesheet would need to be paying attention when they update to accommodate the new classes in their stylesheet.  But this is something that we can certainly do on the fly using the wpmem_msg_dialog filter.  This article will show you how to do just that.  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