391 | | // 'term_order' is a legal sort order only when joining the relationship table. |
392 | | $_orderby = $this->query_vars['orderby']; |
393 | | if ( 'term_order' === $_orderby && empty( $this->query_vars['object_ids'] ) ) { |
394 | | $_orderby = 'term_id'; |
| 391 | $order = ''; |
| 392 | $orderby = ''; |
| 393 | $_orderby = $this->query_vars['orderby']; |
| 394 | $_orderby_array = array(); |
| 395 | |
| 396 | if ( ! is_array( $_orderby ) ) { |
| 397 | $_order = $this->parse_order( $this->query_vars['order'] ); |
| 398 | $_orderby = explode( ' ', $_orderby ); |
| 399 | $_orderby = array_fill_keys( $_orderby, $_order ); |
398 | | if ( $orderby ) { |
399 | | $orderby = "ORDER BY $orderby"; |
| 402 | foreach ( $_orderby as $__orderby => $_order ) { |
| 403 | // 'term_order' is a legal sort order only when joining the relationship table. |
| 404 | if ( 'term_order' === $__orderby && empty( $this->query_vars['object_ids'] ) ) { |
| 405 | $__orderby = 'term_id'; |
| 406 | } |
| 407 | $__orderby = addslashes_gpc( urldecode( $__orderby ) ); |
| 408 | $parsed = $this->parse_orderby( $__orderby ); |
| 409 | // Only allow certain values for safety. |
| 410 | if ( ! $parsed ) { |
| 411 | continue; |
| 412 | } |
| 413 | |
| 414 | $_orderby_array[] = $parsed . ' ' . $this->parse_order( $_order ); |