Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/**
* Stores the information submitted profile update
*
*/
function pw_rcp_save_user_fields_on_profile_save( $user_id ) {
if( ! empty( $_POST['rcp_profession'] ) ) {
update_user_meta( $user_id, 'rcp_profession', sanitize_text_field( $_POST['rcp_profession'] ) );
}
if( ! empty( $_POST['rcp_location'] ) ) {
update_user_meta( $user_id, 'rcp_location', sanitize_text_field( $_POST['rcp_location'] ) );
}
}
add_action( 'rcp_user_profile_updated', 'pw_rcp_save_user_fields_on_profile_save', 10 );
add_action( 'rcp_edit_member', 'pw_rcp_save_user_fields_on_profile_save', 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.