Restrict Content Pro
rcp_after_password_registration_field
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 inside the registration form’s user fieldset (register-common.php), after the password and password-confirm fields and before membership level/subscription fields.
It runs only when the visitor is not logged in (in the same block as the account fields). Output HTML here so fields submit with registration. Validate on rcp_form_errors with error group 'register'.
Parameters
None.
Examples
function mytheme_rcp_after_password_registration_field() {
?>
<p id="rcp_phone_wrap">
<label for="rcp_phone"><?php esc_html_e( 'Phone', 'mytheme' ); ?></label>
<input type="text" name="rcp_phone" id="rcp_phone" value="<?php echo isset( $_POST['rcp_phone'] ) ? esc_attr( wp_unslash( $_POST['rcp_phone'] ) ) : ''; ?>" />
</p>
<?php
}
add_action( 'rcp_after_password_registration_field', 'mytheme_rcp_after_password_registration_field' );
Related: rcp_before_register_form_fields, Creating Custom Registration Fields.