• 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 » API Functions » wpmem_ic_add_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 );

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