Function
Privacy and compatibility functions
On this page
- rpress_remove_post_types_order()
- rpress_disable_jetpack_og_on_checkout()
- rpress_is_caching_plugin_active()
- rpress_append_no_cache_param()
- rpress_qtranslate_content()
- rpress_qtranslate_prevent_redirect()
- rpress_disable_woo_ssl_on_checkout()
- rpress_disable_mandrill_nl2br()
- rpress_disable_404_redirected_redirect()
- rpress_say_what_domain_aliases()
- rpress_rsssl_remove_mixed_content_filter()
- rpress_weglot_translate_url()
- rpress_wpml_is_active()
- rpress_wpml_get_current_language()
- rpress_wpml_translate_page_url()
- rpress_wpml_filter_success_page_uri()
- rpress_wpml_filter_checkout_page_uri()
- rpress_wpml_filter_lostpassword_url()
- rpress_wpml_filter_is_a_restropress_page()
- rpress_wpml_filter_is_checkout()
- rpress_wpml_disable_canonical_redirect()
- rpress_wpml_filter_is_success_page()
- rpress_wpml_get_payment_language()
- rpress_wpml_save_payment_language()
- rpress_wpml_translate_setting_value()
- rpress_wpml_filter_rpress_get_option()
- rpress_wpml_switch_language_for_order()
- rpress_wpml_before_purchase_receipt_email()
- rpress_wpml_restore_language()
- rpress_register_privacy_policy_template()
- rpress_mask_string()
- rpress_mask_domain()
- rpress_pseudo_mask_email()
- rpress_log_terms_and_privacy_times()
- rpress_anonymize_email()
- _rpress_anonymize_customer()
- _rpress_anonymize_payment()
- _rpress_privacy_get_payment_action()
- _rpress_privacy_get_customer_id_for_email()
- rpress_register_privacy_exporters()
- rpress_privacy_customer_record_exporter()
- rpress_privacy_billing_information_exporter()
- rpress_privacy_file_fooditem_log_exporter()
- rpress_privacy_api_access_log_exporter()
- rpress_register_privacy_eraser_customer_id_lookup()
- rpress_privacy_prefetch_customer_id()
- rpress_register_privacy_eraser_customer_id_removal()
- rpress_privacy_remove_customer_id()
- rpress_privacy_maybe_delete_customer_eraser()
- rpress_register_privacy_erasers()
- rpress_privacy_customer_anonymizer()
- rpress_privacy_payment_eraser()
- rpress_privacy_file_fooditem_logs_eraser()
- rpress_privacy_api_access_logs_eraser()
Functions for the WordPress privacy tools (export and erase personal data) and for compatibility with other plugins.
54 functions. Each entry shows the signature, parameters, return value and where it is defined. Functions marked internal are hook callbacks, screen renderers and other plumbing that extensions normally do not call.
rpress_remove_post_types_order()#
Removes the Post Types Order plugin ordering filter on admin list screens.
Hooked to load-edit.php. Removes the CPTOrderPosts callback from posts_orderby so list-table sorting works.
rpress_remove_post_types_order()
Internal. Defined in includes/plugin-compatibility.php, line 24.
rpress_disable_jetpack_og_on_checkout()#
Removes the Jetpack Open Graph tags from the head on the checkout page.
Hooked to template_redirect. Only acts when rpress_is_checkout() is true. Despite the docblock, it returns nothing.
rpress_disable_jetpack_og_on_checkout()
Internal. Defined in includes/plugin-compatibility.php, line 37.
rpress_is_caching_plugin_active()#
Checks whether a known caching plugin (WP Super Cache, W3 Total Cache or WP Rocket) is active.
Detection is by wpsupercache_site_admin(), the W3TC constant or rocket_init(). The result is passed through the rpress_is_caching_plugin_active filter.
rpress_is_caching_plugin_active()
Returns bool: True if a caching plugin is detected, otherwise false.
Example
if ( rpress_is_caching_plugin_active() ) {
// Avoid relying on cached output for this request.
nocache_headers();
}
Defined in includes/plugin-compatibility.php, line 49.
rpress_append_no_cache_param()#
Adds the "No Caching on Checkout?" checkbox to the Misc settings when a caching plugin is active.
Filter callback for rpress_settings_misc. Appends a checkbox setting with the id no_cache_checkout only if rpress_is_caching_plugin_active() is true.
rpress_append_no_cache_param( $settings )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$settings | array | Required | Misc settings array. |
Returns array: The settings array, with the checkbox added when a caching plugin is active.
Internal. Defined in includes/plugin-compatibility.php, line 62.
rpress_qtranslate_content()#
Passes menu item content through qTranslate language selection when qTranslate is active.
Filter callback for rpress_fooditems_content and rpress_fooditems_excerpt. Applies qtrans_useCurrentLanguageIfNotFoundShowAvailable() only if the QT_LANGUAGE constant is defined.
rpress_qtranslate_content( $content )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$content | string | Required | Content or excerpt text. |
Returns string: The content, translated for the current language when qTranslate is active.
Internal. Defined in includes/plugin-compatibility.php, line 81.
rpress_qtranslate_prevent_redirect()#
Stops qTranslate from redirecting URLs that contain "rpressfile".
Filter callback for qtranslate_language_detect_redirect. If the URL contains rpressfile, it returns false and clears url_mode in the global $q_config.
rpress_qtranslate_prevent_redirect( $target )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$target | string | Required | Redirect target URL. |
Returns string|false: The target URL, or false when the redirect is disabled.
Internal. Defined in includes/plugin-compatibility.php, line 95.
rpress_disable_woo_ssl_on_checkout()#
Removes the WooCommerce "un-force SSL" redirect on the checkout page.
Hooked to template_redirect at priority 9. Acts only on the checkout page when rpress_is_ssl_enforced() is true, and removes WC_HTTPS::unforce_https_template_redirect to prevent redirect loops.
rpress_disable_woo_ssl_on_checkout()
Internal. Defined in includes/plugin-compatibility.php, line 111.
rpress_disable_mandrill_nl2br()#
Disables the Mandrill mandrill_nl2br filter while RestroPress emails are sent.
Hooked to rpress_email_send_before. Adds __return_false to the mandrill_nl2br filter.
rpress_disable_mandrill_nl2br()
Internal. Defined in includes/plugin-compatibility.php, line 123.
rpress_disable_404_redirected_redirect()#
Stops the 404 Redirected plugin from treating the order confirmation page as a 404.
Hooked to template_redirect at priority 9. Does nothing unless WBZ404_VERSION is defined. On the success page it removes wbz404_process404.
rpress_disable_404_redirected_redirect()
Internal. Defined in includes/plugin-compatibility.php, line 133.
rpress_say_what_domain_aliases()#
Adds "rpress" as an alias of the "restropress" text domain for the Say What plugin.
rpress_say_what_domain_aliases( $aliases )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$aliases | array | Required | Say What domain aliases. |
Returns array: The aliases with rpress added under restropress.
Internal. Defined in includes/plugin-compatibility.php, line 149.
rpress_rsssl_remove_mixed_content_filter()#
Removes the Really Simple SSL mixed content buffer callbacks during file delivery.
Hooked to plugins_loaded at priority 999. Acts only if the REALLY_SIMPLE_SSL class exists and the rpress_process_verified_fooditem action has fired.
rpress_rsssl_remove_mixed_content_filter()
Internal. Defined in includes/plugin-compatibility.php, line 163.
rpress_weglot_translate_url()#
Rewrites a RestroPress page URL to the current Weglot language.
Filter callback for rpress_get_checkout_uri, rpress_get_success_page_uri, rpress_get_failed_transaction_uri and rpress_get_lostpassword_url at priority 999. Returns the URL unchanged when Weglot is unavailable, the current language is the original language, or an exception occurs.
rpress_weglot_translate_url( $url )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$url | string | Required | URL to translate. |
Returns string: The language-prefixed URL, or the original URL.
Internal. Defined in includes/plugin-compatibility.php, line 180.
rpress_wpml_is_active()#
Checks whether WPML is active.
Returns true if ICL_SITEPRESS_VERSION is defined, icl_object_id() exists, or a wpml_current_language filter is registered. Defined only if no function with this name already exists.
rpress_wpml_is_active()
Returns bool: True if WPML is detected.
Defined in includes/plugin-compatibility.php, line 214.
rpress_wpml_get_current_language()#
Returns the current WPML language code.
Uses the wpml_current_language filter and falls back to the wp-wpml_current_language cookie when the filter returns empty. Returns null when WPML is not active.
rpress_wpml_get_current_language()
Returns string|null: The language code, or null if WPML is not active.
Example
$lang = rpress_wpml_get_current_language();
if ( $lang ) {
error_log( 'Current WPML language: ' . $lang );
}
Defined in includes/plugin-compatibility.php, line 226.
rpress_wpml_translate_page_url()#
Returns the URL of the WPML translation of a RestroPress core page.
Looks up the page ID stored in the setting $page_key, finds its translation with the wpml_object_id filter for the current language, and returns that permalink with the original URL query arguments preserved. Returns $url unchanged if WPML is inactive, the setting is empty, or no different translation exists.
rpress_wpml_translate_page_url( $url, $page_key )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$url | string | Required | The default URL. |
$page_key | string | Required | RestroPress settings key holding the page ID, for example 'success_page' or 'purchase_page'. |
Returns string: The translated page URL, or the original URL.
Example
$url = rpress_wpml_translate_page_url( rpress_get_checkout_uri(), 'purchase_page' );
Defined in includes/plugin-compatibility.php, line 251.
rpress_wpml_filter_success_page_uri()#
Translates the order confirmation page URL with WPML.
Filter callback for rpress_get_success_page_uri. Calls rpress_wpml_translate_page_url() with the success_page setting.
rpress_wpml_filter_success_page_uri( $url )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$url | string | Required | The confirmation page URL. |
Returns string: The translated URL.
Internal. Defined in includes/plugin-compatibility.php, line 283.
rpress_wpml_filter_checkout_page_uri()#
Translates the checkout page URL with WPML.
Filter callback for rpress_get_checkout_uri and rpress_get_failed_transaction_uri. Calls rpress_wpml_translate_page_url() with the purchase_page setting.
rpress_wpml_filter_checkout_page_uri( $url )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$url | string | Required | The checkout page URL. |
Returns string: The translated URL.
Internal. Defined in includes/plugin-compatibility.php, line 289.
rpress_wpml_filter_lostpassword_url()#
Translates the lost password page URL with WPML.
Filter callback for rpress_get_lostpassword_url. Calls rpress_wpml_translate_page_url() with the order_login_page setting.
rpress_wpml_filter_lostpassword_url( $url )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$url | string | Required | The lost password URL. |
Returns string: The translated URL.
Internal. Defined in includes/plugin-compatibility.php, line 295.
rpress_wpml_filter_is_a_restropress_page()#
Treats translated food items, checkout and confirmation pages as RestroPress pages.
Filter callback for is_a_restropress_page. Checks the WPML translations of the food_items_page, purchase_page and success_page settings against the current page.
rpress_wpml_filter_is_a_restropress_page( $is_rp_page )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$is_rp_page | bool | Required | Current result of the check. |
Returns bool: True if the current page is, or translates, a RestroPress page.
Internal. Defined in includes/plugin-compatibility.php, line 308.
rpress_wpml_filter_is_checkout()#
Treats the translated checkout page as the checkout page.
Filter callback for rpress_is_checkout. Compares the current page with the WPML translation of the purchase_page setting.
rpress_wpml_filter_is_checkout( $is_checkout )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$is_checkout | bool | Required | Current result of the check. |
Returns bool: True on the checkout page or its translation.
Internal. Defined in includes/plugin-compatibility.php, line 354.
rpress_wpml_disable_canonical_redirect()#
Disables canonical redirects on translated checkout and confirmation pages.
Filter callback for redirect_canonical. Returns false when the current page is the WPML translation of the success_page or purchase_page setting.
rpress_wpml_disable_canonical_redirect( $redirect_url, $requested_url )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$redirect_url | string|false | Required | Target redirect URL. |
$requested_url | string | Required | Originally requested URL. |
Returns string|false: False to cancel the redirect on those pages, otherwise $redirect_url.
Internal. Defined in includes/plugin-compatibility.php, line 392.
rpress_wpml_filter_is_success_page()#
Treats the translated confirmation page as the order confirmation page.
Filter callback for rpress_is_success_page. Compares the current page with the WPML translation of the success_page setting.
rpress_wpml_filter_is_success_page( $is_success )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$is_success | bool | Required | Current result of the check. |
Returns bool: True on the confirmation page or its translation.
Internal. Defined in includes/plugin-compatibility.php, line 431.
rpress_wpml_get_payment_language()#
Returns the language code stored for an order.
Checks the wpml_element_language_code filter for element type post_rpress_payment, then the wpml_language and _order_language post meta keys.
rpress_wpml_get_payment_language( $payment_id )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment_id | int | Required | Order (payment) ID. |
Returns string|null: The language code, or null if none is found.
Example
$lang = rpress_wpml_get_payment_language( $payment_id );
Defined in includes/plugin-compatibility.php, line 481.
rpress_wpml_save_payment_language()#
Saves the current WPML language as post meta on a newly created order.
Hooked to rpress_insert_payment. Writes the wpml_language post meta when WPML is active and a language is known.
rpress_wpml_save_payment_language( $payment_id, $payment_data = array() )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment_id | int | Required | Order (payment) ID. |
$payment_data | array | array() | Payment data. Not used. |
Internal. Defined in includes/plugin-compatibility.php, line 511.
rpress_wpml_translate_setting_value()#
Translates a RestroPress setting value using WPML String Translation or a per-language option.
For string values, and for string items inside arrays, tries the admin_texts_rpress_settings context, then admin_texts_rpress_settings-en, then the rpress_settings-{lang} option. Returns the value unchanged when $lang is empty. The $default argument is not used.
rpress_wpml_translate_setting_value( $value, $key, $lang, $default = false )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$value | mixed | Required | Setting value. |
$key | string | Required | Setting key. |
$lang | string | Required | Target language code. |
$default | mixed | false | Default fallback. Not used. |
Returns mixed: The translated value, or the original value.
Internal. Defined in includes/plugin-compatibility.php, line 532.
rpress_wpml_filter_rpress_get_option()#
Translates RestroPress option values on read when WPML is active.
Filter callback for rpress_get_option. Uses the order language during email rendering, otherwise the current WPML language, and delegates to rpress_wpml_translate_setting_value().
rpress_wpml_filter_rpress_get_option( $value, $key, $default )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$value | mixed | Required | Existing option value. |
$key | string | Required | Setting key. |
$default | mixed | Required | Default value. |
Returns mixed: The translated option value.
Internal. Defined in includes/plugin-compatibility.php, line 593.
rpress_wpml_switch_language_for_order()#
Switches WPML to an order language before emails are rendered.
Hooked to rpress_complete_purchase and rpress_update_order_status. Stores the order language and the original language in globals, then fires wpml_switch_language. Does nothing if WPML is inactive or the order has no stored language.
rpress_wpml_switch_language_for_order( $payment_id )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment_id | int | Required | Order (payment) ID. |
Internal. Defined in includes/plugin-compatibility.php, line 614.
rpress_wpml_before_purchase_receipt_email()#
Switches WPML to the order language when the receipt sender name is read.
Filter callback for rpress_purchase_from_name at priority 1. Calls rpress_wpml_switch_language_for_order() and returns the sender name unchanged.
rpress_wpml_before_purchase_receipt_email( $from_name, $payment_id, $payment_data = array() )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$from_name | string | Required | Sender name. |
$payment_id | int | Required | Order (payment) ID. |
$payment_data | array | array() | Payment data. Not used. |
Returns string: The unchanged $from_name.
Internal. Defined in includes/plugin-compatibility.php, line 644.
rpress_wpml_restore_language()#
Restores the WPML language that was active before an email was rendered.
Hooked to rpress_email_send_after and rpress_admin_order_notice. Clears the order-language global and fires wpml_switch_language with the saved original language.
rpress_wpml_restore_language()
Internal. Defined in includes/plugin-compatibility.php, line 659.
rpress_register_privacy_policy_template()#
Registers the RestroPress suggested text with the WordPress privacy policy guide.
Hooked to admin_init. Builds the text through the rpress_privacy_policy_content and rpress_privacy_policy_additional_collection filters and passes it to wp_add_privacy_policy_content() under the name RestroPress. Does nothing if that function is unavailable.
rpress_register_privacy_policy_template()
Internal. Defined in includes/privacy-functions.php, line 21.
rpress_mask_string()#
Masks a string with asterisks, keeping its first and last characters.
Strings longer than two characters keep the first and last character. A two-character string keeps the first and replaces the second with *. A one-character string is returned as is, and an empty string returns an empty string.
rpress_mask_string( $string = '' )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$string | string | '' | String to mask. |
Returns string: The masked string.
Example
echo rpress_mask_string( 'admin' ); // a***n
Defined in includes/privacy-functions.php, line 60.
rpress_mask_domain()#
Masks the non-TLD parts of a domain name with asterisks.
Each label before the top-level domain is masked with rpress_mask_string(). When the second-to-last label is three characters or fewer it is treated as part of a country TLD (for example co.uk) and left intact.
rpress_mask_domain( $domain = '' )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$domain | string | '' | Domain name. |
Returns string: The masked domain, or an empty string if $domain is empty.
Example
echo rpress_mask_domain( 'example.org' ); // e*****e.org
Defined in includes/privacy-functions.php, line 85.
rpress_pseudo_mask_email()#
Masks the local part and domain of an email address.
Uses rpress_mask_string() for the local part and rpress_mask_domain() for the domain. Values that fail is_email() are returned unchanged.
rpress_pseudo_mask_email( $email_address )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$email_address | string | Required | Email address to mask. |
Returns string: The masked email address, or the input if it is not a valid email.
Example
echo rpress_pseudo_mask_email( 'admin@example.org' ); // a***n@e*****e.org
Defined in includes/privacy-functions.php, line 115.
rpress_log_terms_and_privacy_times()#
Stores the time a customer agreed to the terms and privacy policy as customer meta.
Hooked to rpress_insert_payment. Adds the agree_to_terms_time and agree_to_privacy_time customer meta values when present in $payment_data. Does nothing if the order has no customer.
rpress_log_terms_and_privacy_times( $payment_id, $payment_data )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment_id | int | Required | Order (payment) ID. |
$payment_data | array | Required | Payment data, which may contain agree_to_terms_time and agree_to_privacy_time. |
Internal. Defined in includes/privacy-functions.php, line 138.
rpress_anonymize_email()#
Returns a salted, non-repeatable hash address at the site.invalid domain.
The local part is a wp_hash() of a unique id, the original local part and the current time, so the same input gives a different result each call. Empty input is returned unchanged.
rpress_anonymize_email( $email_address )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$email_address | string | Required | Email address to anonymize. |
Returns string: An address in the form <hash>@site.invalid, or the empty input.
Example
$anon = rpress_anonymize_email( 'jane@example.com' );
Defined in includes/privacy-functions.php, line 170.
_rpress_anonymize_customer()#
Anonymizes a customer record for privacy erasure.
Fails when the customer is missing, when the rpress_should_anonymize_customer filter declines, or when any of the customer's orders has the action none. Otherwise removes extra emails, clears the saved user address meta, sets the name to "Anonymized Customer", anonymizes the email, clears notes and the user link, fires rpress_anonymize_customer, and adds a note.
_rpress_anonymize_customer( $customer_id = 0 )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$customer_id | int | 0 | Customer ID. |
Returns array: Array with success (bool) and message (string).
Internal. Defined in includes/privacy-functions.php, line 195.
_rpress_anonymize_payment()#
Anonymizes or deletes an order according to its privacy action.
Fails if the order does not exist or the rpress_should_anonymize_payment filter declines. The action comes from _rpress_privacy_get_payment_action(): delete calls rpress_delete_purchase(), anonymize blanks names and address lines, truncates the IP, renames the post, fires rpress_anonymize_payment and saves, and none leaves it unchanged.
_rpress_anonymize_payment( $payment_id = 0 )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment_id | int | 0 | Order (payment) ID. |
Returns array: Array with success (bool) and message (string).
Note: Deletion is permanent when the action resolves to delete.
Internal. Defined in includes/privacy-functions.php, line 293.
_rpress_privacy_get_payment_action()#
Determines whether an order is anonymized, deleted or left alone during privacy erasure.
Uses the setting payment_privacy_status_action_{status} if saved. Otherwise publish, refunded and revoked default to anonymize, failed and abandoned to delete, and everything else to none. The result is filtered by rpress_privacy_payment_status_action_{status}.
_rpress_privacy_get_payment_action( RPRESS_Payment $payment )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment | RPRESS_Payment | Required | The order to evaluate. |
Returns string: One of none, delete or anonymize.
Internal. Defined in includes/privacy-functions.php, line 405.
_rpress_privacy_get_customer_id_for_email()#
Returns the customer stored for an email during an erasure request.
Reads the rpress_priv_{md5(email)} option written by the pre-eraser lookup, so it still works after the customer has been anonymized. If the option is missing the returned customer object has no ID.
_rpress_privacy_get_customer_id_for_email( $email_address )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$email_address | string | Required | Email address of the person whose data is being processed. |
Returns RPRESS_Customer: Customer object for the stored ID.
Example
$customer = _rpress_privacy_get_customer_id_for_email( 'jane@example.com' );
if ( ! empty( $customer->id ) ) {
error_log( 'Erasing customer ' . $customer->id );
}
Note: Only returns a customer while an erasure request is in progress.
Defined in includes/privacy-functions.php, line 451.
rpress_register_privacy_exporters()#
Registers the RestroPress personal data exporters with WordPress.
Filter callback for wp_privacy_personal_data_exporters. Adds exporters for Customer Record, Billing Information, Menu Items and API Access Logs.
rpress_register_privacy_exporters( $exporters )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$exporters | array | Required | Registered exporters. |
Returns array: The exporters array with the RestroPress entries added.
Internal. Defined in includes/privacy-functions.php, line 466.
rpress_privacy_customer_record_exporter()#
Exports the customer record for a WordPress personal data export request.
Returns the customer ID, primary and all emails, name, creation date and the agree-to-terms and privacy timestamps. The group data is filtered by rpress_privacy_customer_record. Returns an empty set when no customer matches the email.
rpress_privacy_customer_record_exporter( $email_address = '', $page = 1 )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$email_address | string | '' | Email address to export data for. |
$page | int | 1 | Export page. Not used. |
Returns array: Exporter result with data and done (always true).
Internal. Defined in includes/privacy-functions.php, line 495.
rpress_privacy_billing_information_exporter()#
Exports order and billing details for a WordPress personal data export request.
Pages through the customer's orders and exports number, dates, total, items, email, billing address, IP and status for each. Each order's data is filtered by rpress_privacy_order_details_item.
rpress_privacy_billing_information_exporter( $email_address = '', $page = 1 )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$email_address | string | '' | Email address to export data for. |
$page | int | 1 | Page of orders to export. |
Returns array: Exporter result with data and done. done is false while orders remain and true once a page has none.
Internal. Defined in includes/privacy-functions.php, line 557.
rpress_privacy_file_fooditem_log_exporter()#
Exports menu item file log entries for a WordPress personal data export request.
Queries file_fooditem logs for the customer, 100 per page, and builds data points filtered by rpress_privacy_file_fooditem_log_item.
rpress_privacy_file_fooditem_log_exporter( $email_address = '', $page = 1 )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$email_address | string | '' | Email address to export data for. |
$page | int | 1 | Page of logs to export. |
Returns array: Exporter result with data and done.
Note: In this version the built data points are never added to the returned data, so exported data is empty. The exporter is registered as "Menu Items".
Internal. Defined in includes/privacy-functions.php, line 692.
rpress_privacy_api_access_log_exporter()#
Exports API access log entries for a WordPress personal data export request.
Looks up the WordPress user by email and exports api_access logs (date, request, IP), 100 per page. Each item is filtered by rpress_privacy_api_access_log_item.
rpress_privacy_api_access_log_exporter( $email_address = '', $page = 1 )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$email_address | string | '' | Email address to export data for. |
$page | int | 1 | Page of logs to export. |
Returns array: Exporter result with data and done.
Internal. Defined in includes/privacy-functions.php, line 765.
rpress_register_privacy_eraser_customer_id_lookup()#
Registers an early eraser that records the customer ID for the email being erased.
Filter callback for wp_privacy_personal_data_erasers at priority 5. Adds the callback rpress_privacy_prefetch_customer_id.
rpress_register_privacy_eraser_customer_id_lookup( $erasers = array() )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$erasers | array | array() | Registered erasers. |
Returns array: The erasers array with the lookup entry added.
Internal. Defined in includes/privacy-functions.php, line 829.
rpress_privacy_prefetch_customer_id()#
Stores the customer ID for an email so later erasers can find it after anonymization.
Saves the ID in the non-autoloaded option rpress_priv_{md5(email)}.
rpress_privacy_prefetch_customer_id( $email_address, $page = 1 )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$email_address | string | Required | Email address of the person whose data is being processed. |
$page | int | 1 | Page. Not used. |
Returns array: Eraser response with done true and no items removed or retained.
Internal. Defined in includes/privacy-functions.php, line 845.
rpress_register_privacy_eraser_customer_id_removal()#
Registers the late erasers that optionally delete the customer and remove the stored ID.
Filter callback for wp_privacy_personal_data_erasers at priority 9999. Adds rpress_privacy_maybe_delete_customer_eraser and rpress_privacy_remove_customer_id.
rpress_register_privacy_eraser_customer_id_removal( $erasers = array() )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$erasers | array | array() | Registered erasers. |
Returns array: The erasers array with the entries added.
Internal. Defined in includes/privacy-functions.php, line 862.
rpress_privacy_remove_customer_id()#
Deletes the temporary customer ID option created for an erasure request.
Deletes the rpress_priv_{md5(email)} option.
rpress_privacy_remove_customer_id( $email_address, $page = 1 )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$email_address | string | Required | Email address of the person whose data is being processed. |
$page | int | 1 | Page. Not used. |
Returns array: Eraser response with done true and no items removed or retained.
Internal. Defined in includes/privacy-functions.php, line 882.
rpress_privacy_maybe_delete_customer_eraser()#
Deletes the customer record when no orders remain after erasure.
Looks up the stored customer, and if the customer has no remaining orders, deletes the customer row and its meta. Otherwise returns a message that the customer was kept.
rpress_privacy_maybe_delete_customer_eraser( $email_address, $page = 1 )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$email_address | string | Required | Email address of the person whose data is being processed. |
$page | int | 1 | Page of orders to check. |
Returns array: Eraser response with items_removed, items_retained, messages and done (always true).
Note: Customer deletion is permanent.
Internal. Defined in includes/privacy-functions.php, line 902.
rpress_register_privacy_erasers()#
Registers the RestroPress personal data erasers with WordPress.
Filter callback for wp_privacy_personal_data_erasers at priority 11. Adds erasers for the customer record, order records and API access logs, in that order.
rpress_register_privacy_erasers( $erasers = array() )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$erasers | array | array() | Registered erasers. |
Returns array: The erasers array with the RestroPress entries added.
Internal. Defined in includes/privacy-functions.php, line 971.
rpress_privacy_customer_anonymizer()#
Anonymizes a customer for a WordPress personal data erasure request.
Resolves the customer from the stored ID and calls _rpress_anonymize_customer(). On failure the reason is returned in messages.
rpress_privacy_customer_anonymizer( $email_address, $page = 1 )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$email_address | string | Required | Email address of the person whose data is being processed. |
$page | int | 1 | Page. Not used. |
Returns array: Eraser response with items_removed, items_retained, messages and done (always true).
Internal. Defined in includes/privacy-functions.php, line 997.
rpress_privacy_payment_eraser()#
Anonymizes or deletes a customer's orders for a WordPress personal data erasure request.
Processes one page of the customer's orders through _rpress_anonymize_payment() and returns done false so WordPress requests the next page. done is true once there are no orders on the page.
rpress_privacy_payment_eraser( $email_address, $page = 1 )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$email_address | string | Required | Email address of the person whose data is being processed. |
$page | int | 1 | Page of orders to process. |
Returns array: Eraser response with items_removed, items_retained, messages and done.
Internal. Defined in includes/privacy-functions.php, line 1029.
rpress_privacy_file_fooditem_logs_eraser()#
Anonymizes the IP addresses in a customer's menu item file logs.
Processes file_fooditem logs 25 per page, replacing _rpress_log_ip with wp_privacy_anonymize_ip() and firing rpress_anonymize_file_fooditem_log for each log.
rpress_privacy_file_fooditem_logs_eraser( $email_address, $page = 1 )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$email_address | string | Required | Email address of the person whose data is being processed. |
$page | int | 1 | Page of logs to process. |
Returns array: Eraser response with items_removed, items_retained, messages and done.
Internal. Defined in includes/privacy-functions.php, line 1085.
rpress_privacy_api_access_logs_eraser()#
Deletes a user's API access logs for a WordPress personal data erasure request.
Looks up the WordPress user by email and deletes api_access logs 25 per page with wp_delete_post(), firing rpress_delete_api_access_log for each.
rpress_privacy_api_access_logs_eraser( $email_address, $page = 1 )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$email_address | string | Required | Email address of the person whose data is being processed. |
$page | int | 1 | Page of logs to process. |
Returns array: Eraser response with items_removed, items_retained, messages and done.
Note: Deletion is permanent.
Internal. Defined in includes/privacy-functions.php, line 1148.
