Restrict Content Pro
rcp_successful_registration
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 after a membership registration completes successfully (payment marked complete/free signup finished). It runs for new signups, manual renewals, upgrades, and downgrades. It does not run for automatic renewals.
The primary call passes three arguments. Some legacy paths (for example, older manual assignment flows) may fire with only the RCP_Member object—accept optional trailing arguments and use func_num_args()/defaults when needed.
Parameters
$member (RCP_Member) – Legacy member object for the user.
$customer (RCP_Customer) – Customer object (when provided).
$membership (RCP_Membership) – Membership that was just activated/completed (when provided).
Examples
function mytheme_rcp_successful_registration( $member, $customer = null, $membership = null ) {
if ( ! $membership instanceof RCP_Membership ) {
return;
}
$levels = array( 1, 2, 3 );
if ( ! in_array( (int) $membership->get_object_id(), $levels, true ) ) {
return;
}
$subject = __( 'Requesting extra information', 'mytheme' );
$message = __( 'Include your email message here.', 'mytheme' );
$emails = new RCP_Emails();
$emails->member_id = $member->ID;
$emails->send( $member->user_email, $subject, $message );
}
add_action( 'rcp_successful_registration', 'mytheme_rcp_successful_registration', 10, 3 );
Related: rcp_form_processing, RCP_Membership, RCP_Customer.