GC_Comment_Query::parse_order()
最后更新于:2021-11-26 22:39:37
GC_Comment_Query::parse_order( string$order)Parse an ‘order’ query variable and cast it to ASC or DESC as necessary.
参数
- $order
-
(string) (Required) The ‘order’ query variable.
响应
(string) The sanitized ‘order’ query variable.
源文件
文件: gc-includes/class-gc-comment-query.php
protected function parse_order( $order ) {
if ( ! is_string( $order ) || empty( $order ) ) {
return 'DESC';
}
if ( 'ASC' === strtoupper( $order ) ) {
return 'ASC';
} else {
return 'DESC';
}
}