/*function at_custom_fields_update( $user_id, $password = "", $meta = array() ) {
if ( !current_user_can( 'edit_user', $user_id ) )
return false;
// updatable fields
$fields = array(
'at_name',
'at_firstname',
'at_gender',
'at_nationality',
'at_livinglocation',
'at_livinglocationbefore',
'at_yearofbirth',
'at_familytype',
'at_childrentype',
'at_retired',
);
foreach ( $fields as $field ) {
$value = stripslashes( trim( $_POST[$field] ) ) ;
$prev_value = get_user_meta( $user_id, $field, true );
if ( ! empty( $value ) ) {
update_user_meta( $user_id, $field, $value, $prev_value );
}
}
}
// custom fields update
add_action( 'edit_user_profile_update', 'at_custom_fields_update' ); // Don't work on the frontend !
add_action( 'personal_options_update', 'at_custom_fields_update' ); // Don't work on the frontend !
*/
<input class="text" size="40" type="text" name="at_yearofbirth" id="at_yearofbirth" value=<?php if (isset($_POST['at_yearofbirth'])) { echo esc_attr($_POST['at_yearofbirth']); } else { echo get_user_meta( $user_id, 'at_yearofbirth', true ) ; } ?>>
There are currently 1 users browsing this thread. (0 members and 1 guests)