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.

Метод класса: Users{}

Хуков нет.

Возвращает

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

Использование

$result = Users::delete_site_user_meta( $user_id, $meta_key, $meta_value );
$user_id(int) (обязательный)
User ID.
$meta_key(строка) (обязательный)
Metadata name.
$meta_value(разное)
Metadata value. If provided, rows will only be removed that match the value. Must be serializable if non-scalar.
По умолчанию: ''

Код Users::delete_site_user_meta() 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 );
}