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
*
* @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. |