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

Filters

Restrict a post or a page to a specific user role

Chad Butler · Jun 20, 2023 ·

While the core plugin restricts posts to logged in users, and can also create memberships for other types of restriction, sometimes you may wish to restrict content to a user role.

This custom code snippet can be copy-pasted to wherever you store custom code and will add a list of roles to the WP-Members restriction meta box in the post editor, and then will restrict the content based on those roles.

Note that this functionality is included in the WP-Members Advanced Options extension.

Continue Reading →

Login with Username or Email

Chad Butler · Dec 1, 2018 ·

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

 

Part of the WP-Members 3.2 project involved allowing users to log in using either their username or their email address. This makes the WP-Members Email as Username extension obsolete (which, if you’re wondering, is why it is no longer supported).

However, because all of the translation files still reflect “Username” in the login form field text, I decided to give the translators time to catch up on the language packs.  So while you can log in using either a username or an email address, the label on the form only says “Username.”  Continue Reading →

Send new user activation link with manual admin approval

Chad Butler · Mar 19, 2018 ·

This post describes a very similar process to what is described in the tutorial titled “Send new user an activation link in the new registration email.” The twist on this version is that this will send the user an email requesting that they confirm their email address, then it will send the admin a notification to manually activate that user.

The original version in the other tutorial was intended for use where users just need to confirm their email address. This version is for confirming their email address and then approving the account. Continue Reading →

Customizing form fields in WP-Members 3.1.7

Chad Butler · Jan 23, 2017 ·

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

 

As I mentioned in the WP-Members 3.1.7 announcement, there is a new filter hook that will allow greater flexibility of customizing form fields that are used when the registration form is displayed.  One common request that this solves in a better way is how do I display fields for registration but not for user profile or vice versa.

Continue Reading →

Change the WordPress new user notification using the wp_mail filter

Chad Butler · Jul 11, 2016 ·

I have shown in the past how to change the WordPress new user notification by rewriting the wp_new_user_notification() function, which is a pluggable function.  But the transition from WP 4.2 to 4.3 showed why even pluggable functions can be problematic.  So here is a way to do it with a filter that almost no one knows about – wp_mail.  Continue Reading →

  • Page 1
  • Page 2
  • Page 3
  • Interim pages omitted …
  • Page 16
  • 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