Fix skip empty key logic

This commit is contained in:
Emili Castells Guasch 2023-07-04 17:29:44 +02:00
parent e38bd8f503
commit 45c69350e3

View file

@ -249,10 +249,10 @@ class VaultingModule implements ModuleInterface {
$timestamp = time();
foreach ( $customers as $id ) {
$metadata_exist = metadata_exists( 'user', $id, 'ppcp-vault-token' );
$tokens = array_filter( get_user_meta( $id, 'ppcp-vault-token' ) );
$skip_empty_key_migration = apply_filters( 'ppcp_skip_payment_tokens_empty_key_migration', true );
if ( ! $metadata_exist && $skip_empty_key_migration ) {
return;
if ( empty( $tokens ) && $skip_empty_key_migration ) {
continue;
}
/**