Skip to content

Instantly share code, notes, and snippets.

@pippinsplugins
Last active December 15, 2017 18:40
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/901bca4b7b13deddd4f7 to your computer and use it in GitHub Desktop.
Save pippinsplugins/901bca4b7b13deddd4f7 to your computer and use it in GitHub Desktop.
<?php
/**
* Adds the custom fields to the member edit screen
*
*/
function pw_rcp_add_member_edit_fields( $user_id = 0 ) {
$profession = get_user_meta( $user_id, 'rcp_profession', true );
$location = get_user_meta( $user_id, 'rcp_location', true );
?>
<tr valign="top">
<th scope="row" valign="top">
<label for="rcp_profession"><?php _e( 'Profession', 'rcp' ); ?></label>
</th>
<td>
<input name="rcp_profession" id="rcp_profession" type="text" value="<?php echo esc_attr( $profession ); ?>"/>
<p class="description"><?php _e( 'The member\'s profession', 'rcp' ); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row" valign="top">
<label for="rcp_location"><?php _e( 'Location', 'rcp' ); ?></label>
</th>
<td>
<input name="rcp_location" id="rcp_location" type="text" value="<?php echo esc_attr( $location ); ?>"/>
<p class="description"><?php _e( 'The member\'s location', 'rcp' ); ?></p>
</td>
</tr>
<?php
}
add_action( 'rcp_edit_member_after', 'pw_rcp_add_member_edit_fields' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment