LLMS_Query_Quiz_Attempt::parse_args()
Parses data passed to $statuses Convert strings to array and ensure resulting array contains only valid statuses If no valid statuses, returns to the default
Description Description
Return Return
(void)
Source Source
File: includes/class.llms.query.quiz.attempt.php
protected function parse_args() { // sanitize post & user ids foreach ( array( 'student_id', 'quiz_id' ) as $key ) { $this->arguments[ $key ] = $this->sanitize_id_array( $this->arguments[ $key ] ); } // validate status args $valid_statuses = array_keys( llms_get_quiz_attempt_statuses() ); foreach ( array( 'status', 'status_exclude' ) as $key ) { // allow single statuses to be passed in as a string if ( is_string( $this->arguments[ $key ] ) ) { $this->arguments[ $key ] = array( $this->arguments[ $key ] ); } // ensure submitted statuses are valid if ( $this->arguments[ $key ] ) { $this->arguments[ $key ] = array_intersect( $valid_statuses, $this->arguments[ $key ] ); } } }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.16.0 | Introduced. |