LLMS_Question::update_choice( array $data )
Update a question choice
Description Description
If no id is supplied will create a new choice.
Parameters Parameters
- $data
-
(array) (Required) Array of choice data.
Return Return
(string|boolean)
Source Source
File: includes/models/model.llms.question.php
747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 | * * @param array $data Array of choice data. * @ return string|boolean */ public function update_choice( $data ) { // If there's no ID, we'll add a new choice. if ( ! isset( $data [ 'id' ] ) ) { return $this ->create_choice( $data ); } // Get the question. $choice = $this ->get_choice( $data [ 'id' ] ); if ( ! $choice ) { return false; } $choice ->update( $data )->save(); |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.16.0 | Introduced. |