Skip to content

Instantly share code, notes, and snippets.

@styledev
Created November 27, 2012 21:43
Show Gist options
  • Save styledev/4157287 to your computer and use it in GitHub Desktop.
Save styledev/4157287 to your computer and use it in GitHub Desktop.
public function profile_save( $user_id ) {
$fields = self::$setup['theme']['profile']['fields'];
if ( !current_user_can( 'edit_user', $user_id ) ) return false;
foreach ($fields as $field => $attr) {
if ( isset($_POST[$field]) || isset($_FILES[$field]) ) {
$value = $_POST[$field];
if ( $value ) update_user_meta( $user_id, $field, $value );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment