WordPress at a glance
функция не описана

WP_Query::parse_order() protected WP 4.0.0

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

It's a method of the class: WP_Query{}

Хуков нет.

Возвращает

String. The sanitized 'order' query variable.

Использование

// protected - for code of main (parent) or child class
$result = $this->parse_order( $order );
$order(string) (required)
The 'order' query variable.

Changelog

Since 4.0.0 Introduced.

Код WP_Query::parse_order() WP 5.5.1

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

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