Ticket #43931: 43931.2.diff
File 43931.2.diff, 7.5 KB (added by , 7 years ago) |
---|
-
src/wp-admin/includes/admin-filters.php
133 133 add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 ); 134 134 135 135 // Privacy hooks 136 add_filter( 'wp_privacy_personal_data_export_page', 'wp_privacy_process_personal_data_export_page', 10, 6);136 add_filter( 'wp_privacy_personal_data_export_page', 'wp_privacy_process_personal_data_export_page', 10, 7 ); 137 137 add_action( 'wp_privacy_personal_data_export_file', 'wp_privacy_generate_personal_data_export_file', 10 ); 138 138 139 139 // Privacy policy text changes check. -
src/wp-admin/includes/ajax-actions.php
4409 4409 wp_send_json_error( __( 'Exporter index out of range.' ) ); 4410 4410 } 4411 4411 4412 $index = $exporter_index - 1;4413 4414 4412 if ( $page < 1 ) { 4415 4413 wp_send_json_error( __( 'Page index cannot be less than one.' ) ); 4416 4414 } 4417 4415 4418 $exporter = $exporters[ $index ]; 4416 $exporter_keys = array_keys( $exporters ); 4417 $exporter_key = $exporter_keys[ $exporter_index - 1 ]; 4418 $exporter = $exporters[ $exporter_key ]; 4419 4419 4420 4420 if ( ! is_array( $exporter ) ) { 4421 4421 wp_send_json_error( … … 4442 4442 ); 4443 4443 } 4444 4444 4445 $callback = $exporter s[ $index ]['callback'];4446 $exporter_friendly_name = $exporter s[ $index ]['exporter_friendly_name'];4445 $callback = $exporter['callback']; 4446 $exporter_friendly_name = $exporter['exporter_friendly_name']; 4447 4447 4448 4448 $response = call_user_func( $callback, $email_address, $page ); 4449 4449 if ( is_wp_error( $response ) ) { … … 4495 4495 * @param int $page The page for this response. 4496 4496 * @param int $request_id The privacy request post ID associated with this request. 4497 4497 * @param bool $send_as_email Whether the final results of the export should be emailed to the user. 4498 * @param int $exporter_key The key (slug) of the exporter that provided this data. 4498 4499 */ 4499 $response = apply_filters( 'wp_privacy_personal_data_export_page', $response, $exporter_index, $email_address, $page, $request_id, $send_as_email );4500 $response = apply_filters( 'wp_privacy_personal_data_export_page', $response, $exporter_index, $email_address, $page, $request_id, $send_as_email, $exporter_key ); 4500 4501 4501 4502 if ( is_wp_error( $response ) ) { 4502 4503 wp_send_json_error( $response ); … … 4591 4592 wp_send_json_error( __( 'Page index cannot be less than one.' ) ); 4592 4593 } 4593 4594 4594 $index = $eraser_index - 1; // Convert to zero based for eraser index. 4595 $eraser = $erasers[ $index ]; 4595 $eraser_keys = array_keys( $erasers ); 4596 $eraser_key = $eraser_keys[ $eraser_index - 1 ]; 4597 $eraser = $erasers[ $eraser_key ]; 4596 4598 4597 4599 if ( ! is_array( $eraser ) ) { 4598 4600 /* translators: %d: array index */ … … 4614 4616 wp_send_json_error( sprintf( __( 'Eraser array at index %d does not include a friendly name.' ), $eraser_index ) ); 4615 4617 } 4616 4618 4617 $callback = $eraser s[ $index ]['callback'];4618 $eraser_friendly_name = $eraser s[ $index ]['eraser_friendly_name'];4619 $callback = $eraser['callback']; 4620 $eraser_friendly_name = $eraser['eraser_friendly_name']; 4619 4621 4620 4622 $response = call_user_func( $callback, $email_address, $page ); 4621 4623 … … 4706 4708 * @since 4.9.6 4707 4709 * 4708 4710 * @param array $response The personal data for the given exporter and page. 4709 * @param int $e xporter_index The index of the exporter that provided this data.4711 * @param int $eraser_index The index of the eraser that provided this data. 4710 4712 * @param string $email_address The email address associated with this personal data. 4711 4713 * @param int $page The page for this response. 4712 4714 * @param int $request_id The privacy request post ID associated with this request. 4715 * @param int $eraser_key The key (slug) of the eraser that provided this data. 4713 4716 */ 4714 $response = apply_filters( 'wp_privacy_personal_data_erasure_page', $response, $eraser_index, $email_address, $page, $request_id );4717 $response = apply_filters( 'wp_privacy_personal_data_erasure_page', $response, $eraser_index, $email_address, $page, $request_id, $eraser_key ); 4715 4718 4716 4719 if ( is_wp_error( $response ) ) { 4717 4720 wp_send_json_error( $response ); -
src/wp-admin/includes/file.php
2262 2262 * @param int $page The page of personal data for this exporter. Begins at 1. 2263 2263 * @param int $request_id The request ID for this personal data export. 2264 2264 * @param bool $send_as_email Whether the final results of the export should be emailed to the user. 2265 * @param string $exporter_key The slug (key) of the exporter. 2265 2266 * @return array The filtered response. 2266 2267 */ 2267 function wp_privacy_process_personal_data_export_page( $response, $exporter_index, $email_address, $page, $request_id, $send_as_email ) {2268 function wp_privacy_process_personal_data_export_page( $response, $exporter_index, $email_address, $page, $request_id, $send_as_email, $exporter_key ) { 2268 2269 /* Do some simple checks on the shape of the response from the exporter. 2269 2270 * If the exporter response is malformed, don't attempt to consume it - let it 2270 2271 * pass through to generate a warning to the user by default ajax processing. -
src/wp-includes/comment.php
3285 3285 * @return array $exporters An array of personal data exporters. 3286 3286 */ 3287 3287 function wp_register_comment_personal_data_exporter( $exporters ) { 3288 $exporters[ ] = array(3288 $exporters['wordpress-comments'] = array( 3289 3289 'exporter_friendly_name' => __( 'WordPress Comments' ), 3290 3290 'callback' => 'wp_comments_personal_data_exporter', 3291 3291 ); … … 3390 3390 * @return array $erasers An array of personal data erasers. 3391 3391 */ 3392 3392 function wp_register_comment_personal_data_eraser( $erasers ) { 3393 $erasers[ ] = array(3393 $erasers['wordpress-comments'] = array( 3394 3394 'eraser_friendly_name' => __( 'WordPress Comments' ), 3395 3395 'callback' => 'wp_comments_personal_data_eraser', 3396 3396 ); … … 3498 3498 'done' => $done, 3499 3499 ); 3500 3500 } 3501 -
src/wp-includes/media.php
4102 4102 * @return array An array of personal data exporters. 4103 4103 */ 4104 4104 function wp_register_media_personal_data_exporter( $exporters ) { 4105 $exporters[ ] = array(4105 $exporters['wordpress-media'] = array( 4106 4106 'exporter_friendly_name' => __( 'WordPress Media' ), 4107 4107 'callback' => 'wp_media_personal_data_exporter', 4108 4108 ); -
src/wp-includes/user.php
2834 2834 * @return array An array of personal data exporters. 2835 2835 */ 2836 2836 function wp_register_user_personal_data_exporter( $exporters ) { 2837 $exporters[ ] = array(2837 $exporters['wordpress-user'] = array( 2838 2838 'exporter_friendly_name' => __( 'WordPress User' ), 2839 2839 'callback' => 'wp_user_personal_data_exporter', 2840 2840 );