classes/PodsAPI.php
public function save_user( $user_data, $user_meta = null, $strict = false, $sanitized = false, $fields = array() ) {

		if ( ! is_array( $user_data ) || empty( $user_data ) ) {
			return pods_error( __( 'User data is required but is either invalid or empty', 'pods' ), $this );
		}

		$conflicted = pods_no_conflict_check( 'user' );

		if ( ! $conflicted ) {
			pods_no_conflict_on( 'user' );
		}

		if ( ! is_array( $user_meta ) ) {
			$user_meta = array();
		}

		if ( $sanitized ) {
			$user_data = pods_unsanitize( $user_data );
			$user_meta = pods_unsanitize( $user_meta );
		}

		// Set role
		if ( isset( $user_meta['role'] ) ) {
			$user_data['role'] = $user_meta['role'];

			unset( $user_meta['role'] );
		}

		if ( ! isset( $user_data['ID'] ) || empty( $user_data['ID'] ) ) {
			$user_data['ID'] = wp_insert_user( $user_data );
		} elseif ( 1 < count( $user_data ) ) {
			wp_update_user( $user_data );
		}

		if ( is_wp_error( $user_data['ID'] ) ) {
			if ( ! $conflicted ) {
				pods_no_conflict_off( 'user' );
			}

			/**
			 * @var $user_error WP_Error
			 */
			$user_error = $user_data['ID'];

			return pods_error( $user_error->get_error_message(), $this );
		}

		$this->save_user_meta( $user_data['ID'], $user_meta, $strict, $fields );

		if ( ! $conflicted ) {
			pods_no_conflict_off( 'user' );
		}

		return $user_data['ID'];
	}
public function save_user( $user_data, $user_meta = null, $strict = false, $sanitized = false, $fields = array() ) {

		if ( ! is_array( $user_data ) || empty( $user_data ) ) {
			return pods_error( __( 'User data is required but is either invalid or empty', 'pods' ), $this );
		}

		$conflicted = pods_no_conflict_check( 'user' );

		if ( ! $conflicted ) {
			pods_no_conflict_on( 'user' );
		}

		if ( ! is_array( $user_meta ) ) {
			$user_meta = array();
		}

		if ( $sanitized ) {
			$user_data = pods_unsanitize( $user_data );
			$user_meta = pods_unsanitize( $user_meta );
		}

		// Set role
		if ( isset( $user_meta['role'] ) ) {
			$user_data['role'] = $user_meta['role'];

			unset( $user_meta['role'] );
		}

		if ( ! isset( $user_data['ID'] ) || empty( $user_data['ID'] ) ) {
			$user_data['ID'] = wp_insert_user( $user_data );
		} elseif ( 1 < count( $user_data ) ) {
			wp_update_user( $user_data );
		}

		if ( is_wp_error( $user_data['ID'] ) ) {
			if ( ! $conflicted ) {
				pods_no_conflict_off( 'user' );
			}

			/**
			 * @var $user_error WP_Error
			 */
			$user_error = $user_data['ID'];

			return pods_error( $user_error->get_error_message(), $this );
		}

		$this->save_user_meta( $user_data['ID'], $user_meta, $strict, $fields );

		if ( ! $conflicted ) {
			pods_no_conflict_off( 'user' );
		}

		return $user_data['ID'];
	}
public function save_user ( $ user_data , $ user_meta = null , $ strict = false , $ sanitized = false , $ fields = array ( ) ) { if ( ! is_array ( $ user_data ) || empty ( $ user_data ) ) { return pods_error ( __ ( 'User data is required but is either invalid or empty' , 'pods' ) , $ this ) ; } $ conflicted = pods_no_conflict_check ( 'user' ) ; if ( ! $ conflicted ) { pods_no_conflict_on ( 'user' ) ; } if ( ! is_array ( $ user_meta ) ) { $ user_meta = array ( ) ; } if ( $ sanitized ) { $ user_data = pods_unsanitize ( $ user_data ) ; $ user_meta = pods_unsanitize ( $ user_meta ) ; } // Set role if ( isset ( $ user_meta [ 'role' ] ) ) { $ user_data [ 'role' ] = $ user_meta [ 'role' ] ; unset ( $ user_meta [ 'role' ] ) ; } if ( ! isset ( $ user_data [ 'ID' ] ) || empty ( $ user_data [ 'ID' ] ) ) { $ user_data [ 'ID' ] = wp_insert_user ( $ user_data ) ; } elseif ( 1 < count ( $ user_data ) ) { wp_update_user ( $ user_data ) ; } if ( is_wp_error ( $ user_data [ 'ID' ] ) ) { if ( ! $ conflicted ) { pods_no_conflict_off ( 'user' ) ; } /**
			 * @var $user_error WP_Error
			 */ $ user_error = $ user_data [ 'ID' ] ; return pods_error ( $ user_error -> get_error_message ( ) , $ this ) ; } $ this -> save_user_meta ( $ user_data [ 'ID' ] , $ user_meta , $ strict , $ fields ) ; if ( ! $ conflicted ) { pods_no_conflict_off ( 'user' ) ; } return $ user_data [ 'ID' ] ; }
Save a user and it's meta

@param array $user_data All user data to be saved (using wp_insert_user / wp_update_user)
@param array $user_meta (optional) All meta to be saved (set value to null to delete)
@param bool  $strict    (optional) Whether to delete previously saved meta not in $user_meta
@param bool  $sanitized (optional) Will unsanitize the data, should be passed if the data is sanitized before
sending.
@param array $fields    (optional) The array of fields and their options, for further processing with

@return int Returns user id on success

@since 2.0.0
Save a user and it s meta