Revert "Use post_author field instead of post meta in orders admin page"

This reverts commit 6ecc3bc442.
This commit is contained in:
Rodrigo Primo 2018-10-29 11:46:02 -03:00
parent 487ac201c0
commit 7db65aea2c
1 changed files with 9 additions and 15 deletions

View File

@ -772,21 +772,15 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table {
// Filter the orders by the posted customer.
if ( ! empty( $_GET['_customer_user'] ) ) { // WPCS: input var ok.
$customer_id = (int) $_GET['_customer_user']; // WPCS: input var ok, sanitization ok.
if ( version_compare( get_option( 'woocommerce_db_version' ), '3.3.0', '>=' ) ) {
$query_vars['author'] = $customer_id;
} else {
// @codingStandardsIgnoreStart
$query_vars['meta_query'] = array(
array(
'key' => '_customer_user',
'value' => $customer_id,
'compare' => '=',
),
);
// @codingStandardsIgnoreEnd
}
// @codingStandardsIgnoreStart
$query_vars['meta_query'] = array(
array(
'key' => '_customer_user',
'value' => (int) $_GET['_customer_user'], // WPCS: input var ok, sanitization ok.
'compare' => '=',
),
);
// @codingStandardsIgnoreEnd
}
// Sorting.