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

wpmem_login_links

Description

Filter hook to change the links shown on the login page when logged in.

Usage

add_filter( 'wpmem_login_links', function( $string ) {
    // Original link output comes in as a $string.
    // You can add to it before or after, or drop it altogether.

    $string = "<p>I put this before the original links</p>" . $string;
    $string = $string . "<p>This is extra stuff I added after...</p>";

    return $string;
});

Remove the login form from completed registration

Chad Butler · Mar 28, 2012 ·

In the case of moderated registration, where the user may not receive access to the site right away, you may find that you want to show the successful registration message, but eliminate the login form that shows below it by default.  Here is a method to do that using the wpmem_login_form filter.

Continue Reading →

wpmem_restricted_msg

Description

This filters the post restricted message dialog.

The default message string is “<p>This content is restricted to site members. If you are an existing user, please log in. New users may register below.</p>”

Note that the message text can be customized in the plugin’s dialogs tab. Also, if you are running a translated version of the plugin, this string may likely be translated. Keep those things in mind if using this hook to use str_replace on any of the dialog text since str_replace will only work on an exact match.

Usage

/**
 * @param string $str    The post restricted message with HTML.
 * @param string $msg    The raw message string.
 * @param string $before The 'before' HTML wrapper.
 * @param string $after  The 'after' HTML wrapper.
 */
add_filter( 'wpmem_restricted_msg', function( $str, $msg, $before, $after ) {

    /*
     * This example replaces the default <p> tag in the message
     * string with one containing a custom class.
     */
    
    $str = str_replace( '<p>', '<p class="my-custom-class">', $str );

    return $str;
});

wpmem_login_redirect

Description

Filter hook to redirect the user upon login.

Parameters

$redirect_to
(string)(required) The URL to redirect the user to.

$user_id
(integer)(optional) The user’s primary key ID.

Usage

add_filter( 'wpmem_login_redirect', function( $redirect_to, $user_id ) {
    
    // This will redirect to https://yourdomain.com/your-page/
    return home_url( '/your-page/' );

}, 10, 2 );

Notes

In plugin version 3.1.7, the WordPress login_redirect hook was added to login function. A filter for login_redirect would run on all logins across the site (whether from the WP-Members form or any other login form). A filter for wpmem_login_redirect would run only from the WP-Members login forms.

In order of operations, the login_redirect filter is applied first, then wpmem_login_redirect.

Changelog

  • Introduced in 2.7.7
  • $user_id argument added in 2.9.2
  • login_redirect added to login function in 3.1.7

Source

wpmem_login_redirect is located in includes/class-wp-members-user.php

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 48
  • Page 49
  • Page 50
  • Page 51
  • Page 52
  • 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