delete_user_meta_data()

Summary

Delete all customer related usermeta data


Source

File: uninstall.php

function delete_user_meta_data() {
	global $wpdb;
	$customer_id_meta_key = $wpdb->get_blog_prefix() . Customer::CUSTOMER_ID_META;
	
	// all meta-keys => value to be deleted
	$meta_keys            = [
		$customer_id_meta_key                => '',
		User_Profile_Settings::SYNC_PASSWORD => ''
	];

	// Delete metadata
	foreach ( $meta_keys as $key => $value ) {
		\delete_metadata( 'user', null, $key, $value, true );
	}
}


User Contributed Notes

You must log in before being able to contribute a note or feedback.