• 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 » Plugins » WP-Members » Documentation » Filter Hooks » wpmem_post_password

wpmem_post_password

Description

Filter hook to filter the post password.

This filter can filter the autogenerated post password that is created by the plugin to automatically protect comments.  There are some instances where a theme may not work well with this process and will put in the WP protected post dialog.  In these instances, the filter can be used to return a blank post password, thus returning WordPress to thinking the post is not password protected.

The example below demonstrates using the filter to return an empty post password.

Parameters

$password
(string) The autogenerated password from wp_generate_password.

Changelog

Introduced in version 2.8.0

Source

wpmem_securify is located in wp-members-core.php

Usage

/**
 * Fixes password spoof - the plugin sets a post password to protect
 * the comment form.  In themes where this causes the WP password
 * protected post dialog to display, returning an empty post password
 * should correct the problem.
 */

add_filter( 'wpmem_post_password', 'my_pass_filter' );
function my_pass_filter() {
    return '';
}

/**
 * Here is the same thing using the __return_empty_string WP function.
 * This allows you to accomplish the same thing as above in a 
 * single line without creating an unnecessary method.  See:
 * http://codex.wordpress.org/Function_Reference/_return_empty_string
 */

add_filter( 'wpmem_post_password', '__return_empty_string' );

See a list of all filter and action hooks

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