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
This is a list of erasers.
$export_priority  : int
This is a priority for the wp_privacy_personal_data_exporters filter
$exporters  : array
This is a list of exporters.
__construct()  : mixed
Init - hook into events.
add_eraser()  : array
Add eraser to list of erasers.
add_exporter()  : array
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
Integrate this eraser implementation within the WordPress core erasers.
register_exporters()  : array
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 $callback) : array
Parameters
$id : string

ID of the Eraser.

$name : string

Exporter name.

$callback : string|array

Exporter callback.

Return values
array

add_exporter()

Add exporter to list of exporters.

public add_exporter(string $id, string $name, string|array $callback) : array
Parameters
$id : string

ID of the Exporter.

$name : string

Exporter name.

$callback : string|array

Exporter callback.

Return values
array

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

To be overloaded by the implementor.

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 $erasers = array() ]) : array
Parameters
$erasers : array = array()

List of eraser callbacks.

Return values
array

register_exporters()

Integrate this exporter implementation within the WordPress core exporters.

public register_exporters([array $exporters = array() ]) : array
Parameters
$exporters : array = array()

List of exporter callbacks.

Return values
array

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 $query) : int
Parameters
$query : array

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 $query) : int
Parameters
$query : array

Query array to pass to wc_get_orders().

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