WordPress at a glance
function is not described

WP_Query::parse_order() WP 4.0.0

Parse an 'order' query variable and cast it to ASC or DESC as necessary.

This is a method of the class: WP_Query

No Hooks.

Return

String. The sanitized 'order' query variable.

Usage

$WP_Query = new WP_Query();
$var = $WP_Query->parse_order( $order );
$order(string) (required)
The 'order' query variable.

Changelog

Since 4.0.0 Introduced.

Code of WP Query::parse order: wp-includes/class-wp-query.php WP 5.2.2

<?php
protected function parse_order( $order ) {
	if ( ! is_string( $order ) || empty( $order ) ) {
		return 'DESC';
	}

	if ( 'ASC' === strtoupper( $order ) ) {
		return 'ASC';
	} else {
		return 'DESC';
	}
}