rcp_add_discount

Runs immediately after a new discount code is added to the database.

Parameters:

  • $args - Array of discount arguments, including:
    • 'name'
    • 'description'
    • 'amount'
    • 'status'
    • 'unit'
    • 'code'
    • 'expiration'
    • 'max_uses'
    • 'use_count'
    • 'subscription_id'
  • $discount_id - ID of the newly created discount code.