Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
LLMS_Question::sort_choices( string $choice_a, string $choice_b )
Sort choices by marker.
Parameters Parameters
- $choice_a
-
(string) (Required) Serialized choice data.
- $choice_b
-
(string) (Required) Serialized choice data.
Return Return
(int)
Source Source
File: includes/models/model.llms.question.php
private function sort_choices( $choice_a, $choice_b ) { $a_data = unserialize( $choice_a->data, array( 'allowed_classes' => false ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_unserialize $b_data = unserialize( $choice_b->data, array( 'allowed_classes' => false ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_unserialize return strnatcmp( $a_data['marker'], $b_data['marker'] ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
4.4.0 | Don't allow objects when using unserialize() . |
3.30.1 | Introduced. |