wordpress/wp-content/themes/basic/themify/themify-metabox/includes/themify-user-fields.php
/**
	 * Save custom fields for user profiles
	 *
	 */
Save custom fields for user profiles
Save custom fields for user profiles
function save_user_field( $user_id ) {
	    if ( ! current_user_can( 'edit_user', $user_id ) )
	        return false;
		$groups = $this->get_fields();
		if( empty( $groups ) ) {
			return false;
		}
		foreach( $groups as $group ) {
			foreach( $group['fields'] as $field ) {
				if( isset( $_POST[$field['name']] ) ) {
					update_user_meta( $user_id, $field['name'], $_POST[$field['name']] );
				}
			}
		}
	}
function save_user_field ( $ user_id ) { if ( ! current_user_can ( 'edit_user' , $ user_id ) ) return false ; $ groups = $ this -> get_fields ( ) ; if ( empty ( $ groups ) ) { return false ; } foreach ( $ groups as $ group ) { foreach ( $ group [ 'fields' ] as $ field ) { if ( isset ( $ _POST [ $ field [ 'name' ] ] ) ) { update_user_meta ( $ user_id , $ field [ 'name' ] , $ _POST [ $ field [ 'name' ] ] ) ; } } } }
Save custom fields for user profiles
Save custom fields for user profiles
// only saves if the current user can edit user profiles