Restrict Content Pro
rcp_add_subscription
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/
Fires when saving a newly added subscription level. Use this with rcp_add_subscription_form if you added a custom field to the Add New Level form.
Parameters
$level_id (int) – ID of the newly created subscription level.
$args (array) – Array of arguments used to create the new subscription level.
Example
/**
* Save a custom field from the Add New Level form.
*
* @param int $level_id ID of the newly created subscription level.
* @param array $args Arguments used to create the level.
*/
function rcpga_save_groups_checkbox_subscription( $level_id, $args ) {
if ( empty( $_POST['rcpga-group-seats-allow'] ) ) {
return;
}
// Save your custom value for $level_id here.
}
add_action( 'rcp_add_subscription', 'rcpga_save_groups_checkbox_subscription', 10, 2 );
The 2 in add_action is required so the callback receives both $level_id and $args.