WC_Customer_Download_Data_Store::delete_by_user_email()publicWC 3.4.0

Method to delete a download permission from the database by user email.

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

Хуков нет.


true|false. True if deleted rows.


$WC_Customer_Download_Data_Store = new WC_Customer_Download_Data_Store();
$WC_Customer_Download_Data_Store->delete_by_user_email( $email );
$email(строка) (обязательный)
email of the downloads that will be deleted.

Список изменений

С версии 3.4.0 Введена.

Код WC_Customer_Download_Data_Store::delete_by_user_email() WC 8.9.3

public function delete_by_user_email( $email ) {
	global $wpdb;
	// Delete related records in wc_download_log (aka ON DELETE CASCADE).
	$this->delete_download_log_by_field_value( 'user_email', $email );

	return (bool) $wpdb->query(
			"DELETE FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions
			WHERE user_email = %s",