Add hierarhical managment
This commit is contained in:
@@ -1803,7 +1803,7 @@ function wp_print_request_filesystem_credentials_modal() {
|
||||
*
|
||||
* @since 4.9.6
|
||||
*
|
||||
* @param array $group_data {
|
||||
* @param array $group_data {
|
||||
* The group data to render.
|
||||
*
|
||||
* @type string $group_label The user-facing heading for the group, e.g. 'Comments'.
|
||||
@@ -1865,7 +1865,7 @@ function wp_privacy_generate_personal_data_export_group_html( $group_data ) {
|
||||
*
|
||||
* @since 4.9.6
|
||||
*
|
||||
* @param int $request_id The export request ID.
|
||||
* @param int $request_id The export request ID.
|
||||
*/
|
||||
function wp_privacy_generate_personal_data_export_file( $request_id ) {
|
||||
if ( ! class_exists( 'ZipArchive' ) ) {
|
||||
@@ -1889,9 +1889,8 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) {
|
||||
$exports_dir = wp_privacy_exports_dir();
|
||||
$exports_url = wp_privacy_exports_url();
|
||||
|
||||
$result = wp_mkdir_p( $exports_dir );
|
||||
if ( is_wp_error( $result ) ) {
|
||||
wp_send_json_error( $result->get_error_message() );
|
||||
if ( ! wp_mkdir_p( $exports_dir ) ) {
|
||||
wp_send_json_error( __( 'Unable to create export folder.' ) );
|
||||
}
|
||||
|
||||
// Protect export folder from browsing.
|
||||
@@ -2030,7 +2029,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) {
|
||||
* @param string $archive_pathname The full path to the export file on the filesystem.
|
||||
* @param string $archive_url The URL of the archive file.
|
||||
* @param string $html_report_pathname The full path to the personal data report on the filesystem.
|
||||
* @param string $request_id The export request ID.
|
||||
* @param int $request_id The export request ID.
|
||||
*/
|
||||
do_action( 'wp_privacy_personal_data_export_file_created', $archive_pathname, $archive_url, $html_report_pathname, $request_id );
|
||||
}
|
||||
@@ -2051,8 +2050,8 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) {
|
||||
*
|
||||
* @since 4.9.6
|
||||
*
|
||||
* @param int $request_id The request ID for this personal data export.
|
||||
* @return true|WP_Error True on success or `WP_Error` on failure.
|
||||
* @param int $request_id The request ID for this personal data export.
|
||||
* @return true|WP_Error True on success or `WP_Error` on failure.
|
||||
*/
|
||||
function wp_privacy_send_personal_data_export_email( $request_id ) {
|
||||
// Get the request data.
|
||||
@@ -2062,11 +2061,11 @@ function wp_privacy_send_personal_data_export_email( $request_id ) {
|
||||
return new WP_Error( 'invalid', __( 'Invalid request ID when sending personal data export email.' ) );
|
||||
}
|
||||
|
||||
/** This filter is documented in wp-admin/includes/file.php */
|
||||
/** This filter is documented in wp-includes/functions.php */
|
||||
$expiration = apply_filters( 'wp_privacy_export_expiration', 3 * DAY_IN_SECONDS );
|
||||
$expiration_date = date_i18n( get_option( 'date_format' ), time() + $expiration );
|
||||
|
||||
/* translators: Do not translate EXPIRATION, LINK, EMAIL, SITENAME, SITEURL: those are placeholders. */
|
||||
/* translators: Do not translate EXPIRATION, LINK, SITENAME, SITEURL: those are placeholders. */
|
||||
$email_text = __(
|
||||
'Howdy,
|
||||
|
||||
@@ -2077,8 +2076,6 @@ so please download it before then.
|
||||
|
||||
###LINK###
|
||||
|
||||
This email has been sent to ###EMAIL###.
|
||||
|
||||
Regards,
|
||||
All at ###SITENAME###
|
||||
###SITEURL###'
|
||||
@@ -2090,7 +2087,6 @@ All at ###SITENAME###
|
||||
* The following strings have a special meaning and will get replaced dynamically:
|
||||
* ###EXPIRATION### The date when the URL will be automatically deleted.
|
||||
* ###LINK### URL of the personal data export file for the user.
|
||||
* ###EMAIL### The email we are sending to.
|
||||
* ###SITENAME### The name of the site.
|
||||
* ###SITEURL### The URL to the site.
|
||||
*
|
||||
@@ -2184,6 +2180,7 @@ function wp_privacy_process_personal_data_export_page( $response, $exporter_inde
|
||||
update_post_meta( $request_id, '_export_data_raw', $export_data );
|
||||
|
||||
// If we are not yet on the last page of the last exporter, return now.
|
||||
/** This filter is documented in wp-admin/includes/ajax-actions.php */
|
||||
$exporters = apply_filters( 'wp_privacy_personal_data_exporters', array() );
|
||||
$is_last_exporter = $exporter_index === count( $exporters );
|
||||
$exporter_done = $response['done'];
|
||||
@@ -2219,7 +2216,13 @@ function wp_privacy_process_personal_data_export_page( $response, $exporter_inde
|
||||
delete_post_meta( $request_id, '_export_data_raw' );
|
||||
update_post_meta( $request_id, '_export_data_grouped', $groups );
|
||||
|
||||
// Generate the export file from the collected, grouped personal data.
|
||||
/**
|
||||
* Generate the export file from the collected, grouped personal data.
|
||||
*
|
||||
* @since 4.9.6
|
||||
*
|
||||
* @param int $request_id The export request ID.
|
||||
*/
|
||||
do_action( 'wp_privacy_personal_data_export_file', $request_id );
|
||||
|
||||
// Clear the grouped data now that it is no longer needed.
|
||||
|
||||
Reference in New Issue
Block a user