Restrict Content Pro

rcp_get_discount_by()

Coming soon: Restrict Content Pro is becoming Kadence Memberships. You may see both names used while we update the product, documentation, and customer experience.

Note: This content is provided as a resource within our developer documentation. Because custom code requires highly specific implementation, we encourage you to work with a qualified developer if you need guidance. You can find our recommended consultants here: https://codeable.io/developers/restrict-content-pro/

Retrieves a single discount record by a column/value combo.

Parameters

  • $column_name (string) — Name of the column.
  • $column_value (mixed) — Value of the column.

Return values

RCP_Discount object on success. false on failure.

Introduced: Version 3.3.

Example

Retrieve a discount by the code beta_tester.

$discount = rcp_get_discount_by( 'code', 'beta_tester' );
Last updated: September 11, 2026
Was this page helpful?
Thanks for the feedback!