• 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 » Search for "short code"

Search Results for: short code

wpmem_block

Description

This filter hook allows you to change the block setting for content. The is_blocked() function determines if content should be blocked or not and passes a true|false boolean to the securify function. If $block is true, content is blocked.  By default, is_blocked tests for posts and pages, but any criteria could be tested in a custom filter function for blocking categories, tags, custom post types, etc.

Parameters

$block
(boolean)(required) A boolean to determine if content should be blocked or not.

$args
(array) (optional) An array of data used in the is_blocked() function.

  • post_id – the post ID
  • post_type – the post type
  • block – the block value (1 = blocked, 0 = unblocked, 2 = hidden)
  • block_meta – “_wpmem_block”
  • block_type – the default value in settings for this post type

Usage

Changelog

  • Introduced in 2.7.5
  • Moved to is_blocked() in WP_Members object in 3.0.0

Source

wpmem_block is located in includes/class-wp-members.php

Code Snippet Library [Subscriber Content]

  • Add a meta box in the post editor for blocking custom post types
  • Blocking Custom Post Types
  • Block Posts After a Set Number of Page Views
  • Automatically block child pages
  • Working with Templates: a Basic Example
  • Blocking custom post types
  • Using wpmem_block to block a category

wpmem_notify_addr

Description

This filter hook can override the email address that is used to send admin notification when a new user registers.  The default address used by the plugin is the address that is set in the WordPress General Settings (admin menu Settings > General).  This filter can change the email address, either single or multiple addresses.

Parameters

$email 
(string)(required) The email to send notifications to (use comma separated string for multiple emails)

Useage

/**
 * This is a single email example.  To change the
 * notification address just return the filtered result.
 */
add_filter( 'wpmem_notify_addr', function( $email ) {
    return 'notify@mydomain.com';
});


/**
 * This is a multiple email example.  Note that your outgoing
 * mail server must support receiving multiple emails as 
 * comma separated values for this to be supported.
 */
add_filter( 'wpmem_notify_addr', function( $email ) {
    return 'notify1@mydomain.com, notify2@mydomain.com';
});


/**
 * Notification addresses can be changed based on your own
 * crititeria, supposing you know a little PHP.
 */
add_filter( 'wpmem_notify_addr', function( $email ) {
    
    // Change the email based on your own custom logic.
    if ( $some_criteria ) {
        $email = 'some_other_email@mydomain.com';
    }
    
    return $email;
});

Changelog

  • Introduced in 2.7.5

Source

wpmem_notify_addr is located in includes/class-wp-members-email.php

Redirect a user on first login

Chad Butler · May 15, 2012 ·

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

 

Suppose you have some information you want to direct first time users to, such as a rules page, or a list of certain posts, etc. You would like to do that the first time they login as a new user.  You can do that with the magic of the wpmem_login_filter. 

Continue Reading →

Show optional form fields only on user update

Chad Butler · Apr 2, 2012 ·

Suppose you have some additional form fields that are not required for registration and you don’t want to show those as part of the registration process; but you would like them to be included when a user updates their registration info.  Here is an elegant way of doing that without resorting so hiding the fields with CSS.  Continue Reading →

wpmem_post_update_data

Description

Action hook gets user’s updated registration data after it is inserted.

All of the _data hooks can be used in a similar manner. The differences are if the user data has
been inserted or not. All of it has passed validation by the time it gets to the hook.

Parameters

$fields
(array) (optional) The user’s submitted form data for the profile update.

$user_id
(string) (optional) The user ID.

Example

add_action( 'wpmem_post_update_data', function( $fields, $user_id ) {

    // Example to display the contents of the array.
    // Uncomment to use.
    // echo "<pre>"; print_r( $fields ); echo "</pre>";
    // exit();

    // Example of setting a custom meta field.
    $meta  = 'my_meta_field';
    $value = 'some value';
    update_user_meta( $fields['ID'], $meta, $value );

    // Note this is an action, so nothing needs to be
    // returned from the function.
    return;
    
}, 10, 2 );

Changelog

  • Introduced in version 2.7.2

Source

wpmem_post_update_data is located in /includes/api/api-users.php

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 47
  • Page 48
  • Page 49
  • Page 50
  • Page 51
  • Interim pages omitted …
  • Page 54
  • Go to Next Page »

Ready to get started?

Join Today!

© 2026 · 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