Allow filtering even when DB stored tokens are empty
This commit is contained in:
parent
83857de24d
commit
e6b74ad629
|
@ -35,16 +35,15 @@ class WC_Payment_Tokens {
|
||||||
$customer_id
|
$customer_id
|
||||||
) );
|
) );
|
||||||
|
|
||||||
if ( empty( $token_results ) ) {
|
|
||||||
return array();
|
|
||||||
}
|
|
||||||
|
|
||||||
$tokens = array();
|
$tokens = array();
|
||||||
foreach ( $token_results as $token_result ) {
|
|
||||||
if ( empty( $gateway_id ) || $gateway_id === $token_result->gateway_id ) {
|
if ( ! empty( $token_results ) ) {
|
||||||
$_token = self::get( $token_result->token_id, $token_result );
|
foreach ( $token_results as $token_result ) {
|
||||||
if ( ! empty( $_token ) ) {
|
if ( empty( $gateway_id ) || $gateway_id === $token_result->gateway_id ) {
|
||||||
$tokens[ $token_result->token_id ] = $_token;
|
$_token = self::get( $token_result->token_id, $token_result );
|
||||||
|
if ( ! empty( $_token ) ) {
|
||||||
|
$tokens[ $token_result->token_id ] = $_token;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue