WooCommerce Code Reference

WC_Privacy extends WC_Abstract_Privacy
in package

WC_Privacy Class.

Table of Contents

$name  : string
This is the name of this object type.
$background_process  : WC_Privacy_Background_Process
Background process to clean up orders.
$erase_priority  : int
This is a priority for the wp_privacy_personal_data_erasers filter
$erasers  : array<string|int, mixed>
This is a list of erasers.
$export_priority  : int
This is a priority for the wp_privacy_personal_data_exporters filter
$exporters  : array<string|int, mixed>
This is a list of exporters.
__construct()  : mixed
Init - hook into events.
add_eraser()  : array<string|int, mixed>
Add eraser to list of erasers.
add_exporter()  : array<string|int, mixed>
Add exporter to list of exporters.
add_privacy_message()  : mixed
Adds the privacy message on WC privacy page.
anonymize_completed_orders()  : int
Anonymize old completed orders.
anonymize_custom_data_types()  : string
Handle some custom types of data and anonymize them.
delete_inactive_accounts()  : int
Delete inactive accounts.
get_privacy_message()  : string
Add privacy policy content for the privacy policy page.
queue_cleanup_personal_data()  : mixed
Spawn events for order cleanup.
register_erasers()  : array<string|int, mixed>
Integrate this eraser implementation within the WordPress core erasers.
register_erasers_exporters()  : mixed
Initial registration of privacy erasers and exporters.
register_exporters()  : array<string|int, mixed>
Integrate this exporter implementation within the WordPress core exporters.
trash_cancelled_orders()  : int
Find and trash old orders.
trash_failed_orders()  : int
Find and trash old orders.
trash_pending_orders()  : int
Find and trash old orders.
anonymize_orders_query()  : int
For a given query, anonymize all matches.
delete_inactive_accounts_query()  : int
Delete inactive accounts.
init()  : mixed
Hook in events.
trash_orders_query()  : int
For a given query trash all matches.

Properties

Methods

add_eraser()

Add eraser to list of erasers.

public add_eraser(string $id, string $name, string|array<string|int, mixed> $callback) : array<string|int, mixed>
Parameters
$id : string

ID of the Eraser.

$name : string

Exporter name.

$callback : string|array<string|int, mixed>

Exporter callback.

Return values
array<string|int, mixed>

add_exporter()

Add exporter to list of exporters.

public add_exporter(string $id, string $name, string|array<string|int, mixed> $callback) : array<string|int, mixed>
Parameters
$id : string

ID of the Exporter.

$name : string

Exporter name.

$callback : string|array<string|int, mixed>

Exporter callback.

Return values
array<string|int, mixed>

anonymize_completed_orders()

Anonymize old completed orders.

public static anonymize_completed_orders([int $limit = 20 ]) : int
Parameters
$limit : int = 20

Limit orders to process per batch.

Tags
since
3.4.0
Return values
intNumber of orders processed.

anonymize_custom_data_types()

Handle some custom types of data and anonymize them.

public anonymize_custom_data_types(string $anonymous, string $type, string $data) : string
Parameters
$anonymous : string

Anonymized string.

$type : string

Type of data.

$data : string

The data being anonymized.

Return values
stringAnonymized string.

delete_inactive_accounts()

Delete inactive accounts.

public static delete_inactive_accounts([int $limit = 20 ]) : int
Parameters
$limit : int = 20

Limit users to process per batch.

Tags
since
3.4.0
Return values
intNumber of users processed.

get_privacy_message()

Add privacy policy content for the privacy policy page.

public get_privacy_message() : string
Tags
since
3.4.0
Return values
string

queue_cleanup_personal_data()

Spawn events for order cleanup.

public queue_cleanup_personal_data() : mixed
Return values
mixed

register_erasers()

Integrate this eraser implementation within the WordPress core erasers.

public register_erasers([array<string|int, mixed> $erasers = array() ]) : array<string|int, mixed>
Parameters
$erasers : array<string|int, mixed> = array()

List of eraser callbacks.

Return values
array<string|int, mixed>

register_erasers_exporters()

Initial registration of privacy erasers and exporters.

public register_erasers_exporters() : mixed

Due to the use of translation functions, this should run only after plugins loaded.

Return values
mixed

register_exporters()

Integrate this exporter implementation within the WordPress core exporters.

public register_exporters([array<string|int, mixed> $exporters = array() ]) : array<string|int, mixed>
Parameters
$exporters : array<string|int, mixed> = array()

List of exporter callbacks.

Return values
array<string|int, mixed>

trash_cancelled_orders()

Find and trash old orders.

public static trash_cancelled_orders([int $limit = 20 ]) : int
Parameters
$limit : int = 20

Limit orders to process per batch.

Tags
since
3.4.0
Return values
intNumber of orders processed.

trash_failed_orders()

Find and trash old orders.

public static trash_failed_orders([int $limit = 20 ]) : int
Parameters
$limit : int = 20

Limit orders to process per batch.

Tags
since
3.4.0
Return values
intNumber of orders processed.

trash_pending_orders()

Find and trash old orders.

public static trash_pending_orders([int $limit = 20 ]) : int
Parameters
$limit : int = 20

Limit orders to process per batch.

Tags
since
3.4.0
Return values
intNumber of orders processed.

anonymize_orders_query()

For a given query, anonymize all matches.

protected static anonymize_orders_query(array<string|int, mixed> $query) : int
Parameters
$query : array<string|int, mixed>

Query array to pass to wc_get_orders().

Tags
since
3.4.0
Return values
intCount of orders that were anonymized.

delete_inactive_accounts_query()

Delete inactive accounts.

protected static delete_inactive_accounts_query(int $timestamp[, int $limit = 20 ]) : int
Parameters
$timestamp : int

Timestamp to delete customers before.

$limit : int = 20

Limit number of users to delete per run.

Tags
since
3.4.0
Return values
intCount of customers that were deleted.

trash_orders_query()

For a given query trash all matches.

protected static trash_orders_query(array<string|int, mixed> $query) : int
Parameters
$query : array<string|int, mixed>

Query array to pass to wc_get_orders().

Tags
since
3.4.0
Return values
intCount of orders that were trashed.