WP_Network_Query::parse_order( string $order ): string
- Since
- 4.6.0
- Source
wp-includes/class-wp-network-query.php:602
Parses an 'order' query variable and cast it to 'ASC' or 'DESC' as necessary.
Parameters
$orderstring- The 'order' query variable.
Return
string- The sanitized 'order' query variable.
Used by · 1
- WP_Network_Query::get_network_ids()Used internally to get a list of network IDs matching the query vars.
Source
protected function parse_order( $order ) { if ( ! is_string( $order ) || empty( $order ) ) { return 'ASC'; } if ( 'ASC' === strtoupper( $order ) ) { return 'ASC'; } else { return 'DESC'; } }History
Introduced in 4.6.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.0.4 tag, from
src/wp-includes/class-wp-network-query.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.