LLMS_Admin_Post_Table_Orders::llms_sort_orders( array $vars )
Order post: Applies custom query variables for sorting custom columns.
Parameters Parameters
- $vars
-
(array) (Required) Fost query args.
Return Return
(array)
Source Source
File: includes/admin/post-types/post-tables/class.llms.admin.post.table.orders.php
public function llms_sort_orders( $vars ) { if ( isset( $vars['post_type'] ) && 'llms_order' == $vars['post_type'] ) { if ( isset( $vars['orderby'] ) && 'order' == $vars['orderby'] ) { $vars = array_merge( $vars, array( 'orderby' => 'ID', ) ); } elseif ( isset( $vars['orderby'] ) && 'product' == $vars['orderby'] ) { $vars = array_merge( $vars, array( 'meta_key' => '_llms_product_title', 'orderby' => 'meta_value', ) ); } elseif ( isset( $vars['orderby'] ) && 'order_date' == $vars['orderby'] ) { $vars = array_merge( $vars, array( 'orderby' => 'date', ) ); } } return $vars; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |