LLMS_Question_Manager::create_question( array $data = array() )
Create a new question and add it to the quiz
Parameters Parameters
- $data
-
(array) (Optional) array of question data
Default value: array()
Return Return
(false|question) id
Source Source
File: includes/class.llms.question.manager.php
89 90 91 92 93 94 95 96 97 98 99 100 101 | public function create_question( $data = array () ) { // Ensure the question belongs to this quiz. $data [ 'parent_id' ] = $this ->get_parent()->get( 'id' ); $question = new LLMS_Question( 'new' , $data ); if ( $question ->get( 'id' ) ) { return $question ->get( 'id' ); } return false; } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.16.0 | Introduced. |