LLMS_Quiz::toArrayAfter( array $arr )

Called before data is sorted and returned by $this->toArray().


Description Description

Extending classes should override this data if custom data should be added when object is converted to an array or json.


Top ↑

Parameters Parameters

$arr

(array) (Required) Array of data to be serialized.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/models/model.llms.quiz.php

	 *
	 * @return LLMS_Question_Manager
	 */
	public function questions() {
		return new LLMS_Question_Manager( $this );
	}

	/**
	 * Called before data is sorted and returned by $this->toArray().
	 * Extending classes should override this data if custom data should
	 * be added when object is converted to an array or json.
	 *
	 * @since 3.3.0
	 * @since 3.19.2 Unknown.
	 * @since 3.38.0 Only add theme metadata to the quiz array when the `llms_get_quiz_theme_settings` filter is being used.
	 *
	 * @param array $arr Array of data to be serialized.
	 * @return array
	 */
	protected function toArrayAfter( $arr ) {

		$arr['questions'] = array();



Top ↑

Changelog Changelog

Changelog
Version Description
3.38.0 Only add theme metadata to the quiz array when the llms_get_quiz_theme_settings filter is being used.
3.3.0
3.19.2 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.