WP_Network_Query::parse_order() protected WP 4.6.0
Parses an 'order' query variable and cast it to 'ASC' or 'DESC' as necessary.
{} It's a method of the class: WP_Network_Query{}
No Hooks.
Return
String. The sanitized 'order' query variable.
Usage
// protected - for code of main (parent) or child class $result = $this->parse_order( $order );
- $order(string) (required)
- The 'order' query variable.
Changelog
Since 4.6.0 | Introduced. |
Code of WP_Network_Query::parse_order() WP Network Query::parse order WP 5.6
protected function parse_order( $order ) {
if ( ! is_string( $order ) || empty( $order ) ) {
return 'ASC';
}
if ( 'ASC' === strtoupper( $order ) ) {
return 'ASC';
} else {
return 'DESC';
}
}