Remove unnecessary checks
This commit is contained in:
parent
f1a9dbc69e
commit
489e67dbe1
|
@ -164,16 +164,11 @@ class WC_Report_Customer_List extends WP_List_Table {
|
|||
'action' => "view",
|
||||
);
|
||||
|
||||
if ( is_email( $user->user_email ) ) {
|
||||
$orders = wc_get_orders( array(
|
||||
'limit' => 1,
|
||||
'status' => array_map( 'wc_get_order_status_name', wc_get_is_paid_statuses() ),
|
||||
'billing_email' => $user->user_email,
|
||||
'customer_id' => 0,
|
||||
) );
|
||||
} else {
|
||||
$orders = array();
|
||||
}
|
||||
$orders = wc_get_orders( array(
|
||||
'limit' => 1,
|
||||
'status' => array_map( 'wc_get_order_status_name', wc_get_is_paid_statuses() ),
|
||||
'customer' => array( array( 0, $user->user_email ) ),
|
||||
) );
|
||||
|
||||
if ( $orders ) {
|
||||
$actions['link'] = array(
|
||||
|
|
|
@ -140,15 +140,10 @@ function wc_update_new_customer_past_orders( $customer_id ) {
|
|||
$linked = 0;
|
||||
$complete = 0;
|
||||
$customer = get_user_by( 'id', absint( $customer_id ) );
|
||||
if ( ! is_email( $customer->user_email ) ) {
|
||||
return $linked;
|
||||
}
|
||||
|
||||
$customer_orders = wc_get_orders( array(
|
||||
'limit' => -1,
|
||||
'billing_email' => $customer->user_email,
|
||||
'customer_id' => 0,
|
||||
'return' => 'ids',
|
||||
'limit' => -1,
|
||||
'customer' => array( array( 0, $customer->user_email ) ),
|
||||
'return' => 'ids',
|
||||
) );
|
||||
|
||||
if ( ! empty( $customer_orders ) ) {
|
||||
|
|
Loading…
Reference in New Issue