Session::set_answer( integer $id )

Description #

Set an answer id in session’s answers offset.

Parameters #

  • $id
    integer (Required) Answer id.

Changelog #

VersionDescription
4.1.7Fixed: new answers are not being set in session.
4.1.5Introduced.

Source #

File: includes/class/class-session.php

	public function set_answer( $id ) {
		$answers = $this->get( 'answers' );

		if ( ! $answers ) {
			$answers = array();
		}

		$answers[] = $id;
		$this->set( 'answers', $answers );
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment