• 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_ic_add_code()

Description

API function to add an invite code.

Can add a code using default arguments or specific code attributes.

Parameters

$args
(array)(optional)

Return

Mixed – returns the invite code on success, otherwise false boolean

Useage

$args = array(
    'invite_code'    => 'The_Invite_Code', // Optional, will generate a value by default
    'description'    => 'A description of the invite code', // Optional
    'uses_remaining' => 1, // limit times a code can be used. Optional, will default to null
    'date_created'   => 'YYYY-MM-DD 00:00:00', // MySQL timestamp format Optional, will set by default
    'date_active'    => 'YYYY-MM-DD 00:00:00', // MySQL timestamp format Optional, will set by default
    'date_expired'   => 'YYYY-MM-DD 00:00:00', // MySQL timestamp format Optional, will set by default
);

$invite_code = wpmem_ic_add_code( $args );

wpmem_ic_code_used

Description

Fires after an invite code has been used for registration.

Parameters

$code_info
(array) An array of details of the code used.

“code_id” | integer | The invite code’s database primary key ID
“user_id” | integer | The user ID of the user
“invite_code” | string | The invite code used to register
“date_used | string | The date the code was used as MySQL timestamp (in string format)

Usage

add_action( 'wpmem_ic_code_used', function( $code_info ) {
    
    // The user ID is in the $code_info array.
    $user_id = $code_info['user_id'];
    
    // What is the slug of the membership to assign?
    $membership = "my-invite-only-membership";
    
    // Assign the membership to the user.
    wpmem_set_user_membership( $membership, $user_id );
    
});

Changelog

  • Introduced in 2.0.0

Source

wpmem_ic_code_used is located in includes/class-wp-members-invite-codes.php

Using Code Snippets from the Site

Chad Butler · Sep 30, 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..

 

When copying code snippets from the site, it is important to copy clean code.  This article discusses where to put it, how to copy it, how to read comments and where to make modifications.  There are also some best practices to follow.

Continue Reading →

User Capabilities

The plugin avoids checking role names for access to various administrative functions as this is not the proper way to control access. WP is a capability-based ruleset, and users can have multiple roles, and various roles can have different capabilities.

For example, the default WP admin role has edit_users permissions, and a custom role created to manage users but not only things the WP admin role can manage can also be given edit_users capability.

The following lists the primary restricted elements of the plugin and what capabilities they are restricted to. Some of the capabilities can be customized (to change the capability checked) by using a filter. If the capability requirement is filterable, it is listed.

All of the default capabilities listed below are only found in the administrator role if your WP instance is simply a default instance (i.e. no custom roles). However, you should not use a role definition if restricting with current_user_can(); rather, this should check the necessary user capability.

A role editor such as User Role Editor will allow you to manage the capabilities assigned to existing roles, and/or create custom roles with unique capability sets based on your specific needs.

Managing plugin options

The plugin’s admin screen is only accessible if the user has manage_options capability.

Managing memberships

This includes adding/editing/deleting membership properties as well as creating new memberships.

To add/edit/delete memberships: manage_options

To filter the capability for displaying the [wpmem_field] shortcode: wpmem_field_sc_required_capability
Default: list_users

Export users

Default capability: list_users

Filter: wpmem_export_args

Array value in filter: $defaults['required_caps']

Admin fields in dashboard user profile

This includes viewing “admin only” fields as well as activating/deactivating users and viewing the WP-Members profile tabs.

Default capability: edit_users

Filter: wpmem_user_profile_caps

Filter is a string value only for this.

See posts in admin that are marked as hidden

Default capability: edit_posts

Filter: none

Admin user actions

The plugin only loads its customizations for the Users > All Users screen for users that have list_users capability. There is no filter to change this, since a user without that capability wouldn’t be able to view that screen anyway. This includes custom user filter views, bulk actions (activate/deactivate, confirm/unconfirm), and user row hover links.

User search and user export is only added if user has list_users capability.

Custom plugin actions attached to post/page editor and all posts/pages screen

The plugin only loads these actions if the user has edit_posts capability. If they didn’t have this capability, they wouldn’t be able to view any of the associated screens anyway.

Understanding what happens during user login

Chad Butler · Jul 23, 2026 ·

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

 

WP-Members’s login process incorporates a number of core WP functions, actions, and filters in order to provide as seamless an integration with other general WP plugins as possible. A lot has to happen to sign in a user, whether using WordPress alone, or along with WP-Members, so it can be confusing when things don’t seem to work correctly. This article breaks down a number of the processes that occur during this process to help you figure out where to look when things go wrong.

Continue Reading →
  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 7
  • Page 8
  • Page 9
  • Page 10
  • Page 11
  • Interim pages omitted …
  • Page 55
  • 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