• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

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 » Invite Codes » Invite Codes Documentation » Action Hooks » wpmem_ic_code_used

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

WP-Members Invite Codes

Plugin Info

Current Stable Version: 2.1.0
Minimum WordPress Version: 5.0
Tested up to WordPress Version: 6.5
Last Updated: 2024-04-06

Documentation

    • Setup
    • Importing Invite Codes
    • Upgrading
    • Filter Hooks
    • Action Hooks
    • API Functions
    • WP CLI Commands
    • Change Log

Get the Plugin

  • Purchase the Plugin
  • Get the Pro Bundle

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