public function process_form( $params, $obj = null, $fields = null, $thank_you = null ) {

		$this->display_errors = false;

		$form = null;

		$nonce    = pods_var( '_pods_nonce', $params );
		$pod      = pods_var( '_pods_pod', $params );
		$id       = pods_var( '_pods_id', $params );
		$uri      = pods_var( '_pods_uri', $params );
		$form     = pods_var( '_pods_form', $params );
		$location = pods_var( '_pods_location', $params );

		if ( is_object( $obj ) ) {
			$pod = $obj->pod;
			$id  = $obj->id();
		}

		if ( ! empty( $fields ) ) {
			$fields = array_keys( $fields );
			$form   = implode( ',', $fields );
		} else {
			$fields = explode( ',', $form );
		}

		if ( empty( $nonce ) || empty( $pod ) || empty( $uri ) || empty( $fields ) ) {
			return pods_error( __( 'Invalid submission', 'pods' ), $this );
		}

		$uid = @session_id();

		if ( is_user_logged_in() ) {
			$uid = 'user_' . get_current_user_id();
		}

		$field_hash = wp_create_nonce( 'pods_fields_' . $form );

		$action = 'pods_form_' . $pod . '_' . $uid . '_' . $id . '_' . $uri . '_' . $field_hash;

		if ( empty( $uid ) ) {
			return pods_error( __( 'Access denied for your session, please refresh and try again.', 'pods' ), $this );
		}

		if ( false === wp_verify_nonce( $nonce, $action ) ) {
			return pods_error( __( 'Access denied, please refresh and try again.', 'pods' ), $this );
		}

		$data = array();

		foreach ( $fields as $field ) {
			$data[ $field ] = pods_var_raw( 'pods_field_' . $field, $params, '' );
		}

		$params = array(
			'pod'      => $pod,
			'id'       => $id,
			'data'     => $data,
			'from'     => 'process_form',
			'location' => $location
		);

		$id = $this->save_pod_item( $params );

		/**
		 * Fires after the form has been processed and save_pod_item has run.
		 *
		 * @param int       $id     Item ID.
		 * @param array     $params save_pod_item parameters.
		 * @param null|Pods $obj    Pod object (if set).
		 */
		do_action( 'pods_api_processed_form', $id, $params, $obj );

		// Always return $id for AJAX requests.
		if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) {
			if ( 0 < $id && ! empty( $thank_you ) ) {
				$thank_you = str_replace( 'X_ID_X', $id, $thank_you );

				pods_redirect( $thank_you, 302, false );
			}
		}

		return $id;
	}