Skip to content

Instantly share code, notes, and snippets.

@pippinsplugins
Created April 29, 2014 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pippinsplugins/94417e3fcf3279be42c9 to your computer and use it in GitHub Desktop.
Save pippinsplugins/94417e3fcf3279be42c9 to your computer and use it in GitHub Desktop.
<?php
/**
* Stores the information submitted during registration
*
*/
function pw_rcp_save_user_fields_on_register( $posted, $user_id ) {
if( ! empty( $posted['rcp_profession'] ) ) {
update_user_meta( $user_id, 'rcp_profession', sanitize_text_field( $posted['rcp_profession'] ) );
}
if( ! empty( $posted['rcp_location'] ) ) {
update_user_meta( $user_id, 'rcp_location', sanitize_text_field( $posted['rcp_location'] ) );
}
}
add_action( 'rcp_form_processing', 'pw_rcp_save_user_fields_on_register', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment