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",
|
'action' => "view",
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( is_email( $user->user_email ) ) {
|
$orders = wc_get_orders( array(
|
||||||
$orders = wc_get_orders( array(
|
'limit' => 1,
|
||||||
'limit' => 1,
|
'status' => array_map( 'wc_get_order_status_name', wc_get_is_paid_statuses() ),
|
||||||
'status' => array_map( 'wc_get_order_status_name', wc_get_is_paid_statuses() ),
|
'customer' => array( array( 0, $user->user_email ) ),
|
||||||
'billing_email' => $user->user_email,
|
) );
|
||||||
'customer_id' => 0,
|
|
||||||
) );
|
|
||||||
} else {
|
|
||||||
$orders = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $orders ) {
|
if ( $orders ) {
|
||||||
$actions['link'] = array(
|
$actions['link'] = array(
|
||||||
|
|
|
@ -140,15 +140,10 @@ function wc_update_new_customer_past_orders( $customer_id ) {
|
||||||
$linked = 0;
|
$linked = 0;
|
||||||
$complete = 0;
|
$complete = 0;
|
||||||
$customer = get_user_by( 'id', absint( $customer_id ) );
|
$customer = get_user_by( 'id', absint( $customer_id ) );
|
||||||
if ( ! is_email( $customer->user_email ) ) {
|
|
||||||
return $linked;
|
|
||||||
}
|
|
||||||
|
|
||||||
$customer_orders = wc_get_orders( array(
|
$customer_orders = wc_get_orders( array(
|
||||||
'limit' => -1,
|
'limit' => -1,
|
||||||
'billing_email' => $customer->user_email,
|
'customer' => array( array( 0, $customer->user_email ) ),
|
||||||
'customer_id' => 0,
|
'return' => 'ids',
|
||||||
'return' => 'ids',
|
|
||||||
) );
|
) );
|
||||||
|
|
||||||
if ( ! empty( $customer_orders ) ) {
|
if ( ! empty( $customer_orders ) ) {
|
||||||
|
|
Loading…
Reference in New Issue