Automattic\WooCommerce\Internal\Admin\Orders

ListTable::do_bulk_action_remove_personal_data()privateWC 1.0

Implements the "remove personal data" bulk action.

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

Хуки из метода

Возвращает

int. Number of orders modified.

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

// private - только в коде основоного (родительского) класса
$result = $this->do_bulk_action_remove_personal_data( $order_ids ): int;
$order_ids(массив) (обязательный)
The Order IDs.

Код ListTable::do_bulk_action_remove_personal_data() WC 8.7.0

private function do_bulk_action_remove_personal_data( $order_ids ): int {
	$changed = 0;

	foreach ( $order_ids as $id ) {
		$order = wc_get_order( $id );

		if ( ! $order ) {
			continue;
		}

		do_action( 'woocommerce_remove_order_personal_data', $order ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
		$changed++;
	}

	return $changed;
}