WP_Network_Query::parse_order() WordPress Method
The WP_Network_Query::parse_order() function is used to parse the 'order' parameter of the WP_Network_Query class. This function is used internally by WordPress.
WP_Network_Query::parse_order( string $order ) #
Parses an ‘order’ query variable and cast it to ‘ASC’ or ‘DESC’ as necessary.
Parameters
- $order
(string)(Required)The 'order' query variable.
Return
(string) The sanitized 'order' query variable.
Source
File: wp-includes/class-wp-network-query.php
protected function parse_order( $order ) { if ( ! is_string( $order ) || empty( $order ) ) { return 'ASC'; } if ( 'ASC' === strtoupper( $order ) ) { return 'ASC'; } else { return 'DESC'; } }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.6.0 | Introduced. |