Restrict Content Pro
rcp_form_processing
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 in rcp_process_registration() after validation has passed, the user/customer and pending membership/payment records exist, and before the visitor is sent to the payment gateway (or free checkout continues). Membership status is still pending.
Use this to save custom registration field meta or run side effects that should happen once the signup has been accepted but before payment completion. Prefer rcp_successful_registration for work that should wait until payment is complete / registration is finished.
Parameters
$posted_data (array) – Raw $_POST from the registration form.
$user_id (int) – WordPress user ID for the registration.
$price (float) – Membership level price used in processing.
$payment_id (int) – Pending payment ID for this registration.
$customer (RCP_Customer) – Customer object.
$membership_id (int) – Pending membership record ID.
$previous_membership (RCP_Membership|false) – Previous membership when renewing/upgrading/downgrading; otherwise false.
$registration_type (string) – new, renewal, upgrade, or downgrade.
Examples
function mytheme_rcp_form_processing( $posted_data, $user_id, $price, $payment_id, $customer, $membership_id, $previous_membership, $registration_type ) {
if ( ! empty( $posted_data['rcp_phone'] ) ) {
update_user_meta( $user_id, 'rcp_phone', sanitize_text_field( wp_unslash( $posted_data['rcp_phone'] ) ) );
}
}
add_action( 'rcp_form_processing', 'mytheme_rcp_form_processing', 10, 8 );
Related: Creating Custom Registration Fields, rcp_successful_registration.