Automattic\WooCommerce\Internal\Utilities

Users::delete_site_user_meta()public staticWC 1.0

Site-specific means of deleting user meta.

This is a multisite-aware wrapper around WordPress's own delete_user_meta() and works by prefixing the supplied meta key with a blog-specific meta key.

Method of the class: Users{}

No Hooks.

Return

true|false. True on success, false on failure. /

Usage

$result = Users::delete_site_user_meta( $user_id, $meta_key, $meta_value );
$user_id(int) (required)
User ID.
$meta_key(string) (required)
Metadata name.
$meta_value(mixed)
Metadata value. If provided, rows will only be removed that match the value. Must be serializable if non-scalar.
Default: ''

Users::delete_site_user_meta() code WC 9.3.3

public static function delete_site_user_meta(  $user_id, $meta_key, $meta_value = '' ) {
	global $wpdb;
	$site_specific_key = $meta_key . '_' . rtrim( $wpdb->get_blog_prefix(), '_' );
	return delete_user_meta( $user_id, $site_specific_key, $meta_value );
}