LLMS_Question::update_choice( array $data )
Update a question choice if no id is supplied will create a new choice
Description Description
Parameters Parameters
- $data
-
(array) (Required) array of choice data (see $this->create_choice())
Return Return
(string|boolean)
Source Source
File: includes/models/model.llms.question.php
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(); // return choice ID return $choice->get( 'id' ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.16.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: