Couple requested changes

This commit is contained in:
claudiulodro 2017-05-13 12:22:22 -07:00
parent d9c5536cf2
commit cec2c3b7dc
2 changed files with 2 additions and 2 deletions

View File

@ -624,7 +624,7 @@ class WC_Order_Data_Store_CPT extends Abstract_WC_Order_Data_Store_CPT implement
}
}
if ( isset( $query_vars['customer'] ) && '' !== $query_vars['customer'] ) {
if ( isset( $query_vars['customer'] ) && ! empty( $query_vars['customer'] ) ) {
$values = is_array( $query_vars['customer'] ) ? $query_vars['customer'] : array( $query_vars['customer'] );
$wp_query_args['meta_query'][] = $this->get_orders_generate_customer_meta_query( $values );
}

View File

@ -51,7 +51,7 @@ function wc_get_orders( $args ) {
$datetime = wc_string_to_datetime( $args['date_before'] );
$date_before = strpos( $args['date_before'], ':' ) ? $datetime->getOffsetTimestamp() : $datetime->date( 'Y-m-d' );
}
if ( ! empty ( $args['date_after'] ) ) {
if ( ! empty( $args['date_after'] ) ) {
$datetime = wc_string_to_datetime( $args['date_after'] );
$date_after = strpos( $args['date_after'], ':' ) ? $datetime->getOffsetTimestamp() : $datetime->date( 'Y-m-d' );
}