Skip to content

Instantly share code, notes, and snippets.

@pippinsplugins
Created April 29, 2014 14:57
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/8477b840a66f7779808b to your computer and use it in GitHub Desktop.
Save pippinsplugins/8477b840a66f7779808b to your computer and use it in GitHub Desktop.
<?php
/**
* Adds the custom fields to the registration form and profile editor
*
*/
function pw_rcp_add_user_fields() {
$profession = get_user_meta( get_current_user_id(), 'rcp_profession', true );
$location = get_user_meta( get_current_user_id(), 'rcp_location', true );
?>
<p>
<label for="rcp_profession"><?php _e( 'Your Profession', 'rcp' ); ?></label>
<input name="rcp_profession" id="rcp_profession" type="text" value="<?php echo esc_attr( $profession ); ?>"/>
</p>
<p>
<label for="rcp_location"><?php _e( 'Your Location', 'rcp' ); ?></label>
<input name="rcp_location" id="rcp_location" type="text" value="<?php echo esc_attr( $location ); ?>"/>
</p>
<?php
}
add_action( 'rcp_after_password_registration_field', 'pw_rcp_add_user_fields' );
add_action( 'rcp_profile_editor_after', 'pw_rcp_add_user_fields' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment