Changeset 43157
- Timestamp:
- 05/03/2018 07:37:32 PM (7 years ago)
- Location:
- branches/4.9
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/src/wp-admin/includes/admin-filters.php
r43101 r43157 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 -
branches/4.9/src/wp-admin/includes/ajax-actions.php
r43111 r43157 4100 4100 } 4101 4101 4102 $index = $exporter_index - 1;4103 4104 4102 if ( $page < 1 ) { 4105 4103 wp_send_json_error( __( 'Page index cannot be less than one.' ) ); 4106 4104 } 4107 4105 4108 $exporter = $exporters[ $index ]; 4106 $exporter_keys = array_keys( $exporters ); 4107 $exporter_key = $exporter_keys[ $exporter_index - 1 ]; 4108 $exporter = $exporters[ $exporter_key ]; 4109 4109 4110 4110 if ( ! is_array( $exporter ) ) { 4111 4111 wp_send_json_error( 4112 /* translators: % d: array index */4113 sprintf( __( 'Expected an array describing the exporter at index % d.' ), $exporter_index)4112 /* translators: %s: array index */ 4113 sprintf( __( 'Expected an array describing the exporter at index %s.' ), $exporter_key ) 4114 4114 ); 4115 4115 } 4116 4116 if ( ! array_key_exists( 'exporter_friendly_name', $exporter ) ) { 4117 4117 wp_send_json_error( 4118 /* translators: % d: array index */4119 sprintf( __( 'Exporter array at index % d does not include a friendly name.' ), $exporter_index)4118 /* translators: %s: array index */ 4119 sprintf( __( 'Exporter array at index %s does not include a friendly name.' ), $exporter_key ) 4120 4120 ); 4121 4121 } … … 4133 4133 } 4134 4134 4135 $callback = $exporters[ $index ]['callback'];4136 $exporter_friendly_name = $exporter s[ $index ]['exporter_friendly_name'];4135 $callback = $exporter['callback']; 4136 $exporter_friendly_name = $exporter['exporter_friendly_name']; 4137 4137 4138 4138 $response = call_user_func( $callback, $email_address, $page ); … … 4186 4186 * @param int $request_id The privacy request post ID associated with this request. 4187 4187 * @param bool $send_as_email Whether the final results of the export should be emailed to the user. 4188 * @param int $exporter_key The key (slug) of the exporter that provided this data. 4188 4189 */ 4189 $response = apply_filters( 'wp_privacy_personal_data_export_page', $response, $exporter_index, $email_address, $page, $request_id, $send_as_email );4190 $response = apply_filters( 'wp_privacy_personal_data_export_page', $response, $exporter_index, $email_address, $page, $request_id, $send_as_email, $exporter_key ); 4190 4191 4191 4192 if ( is_wp_error( $response ) ) { … … 4282 4283 } 4283 4284 4284 $index = $eraser_index - 1; // Convert to zero based for eraser index. 4285 $eraser = $erasers[ $index ]; 4285 $eraser_keys = array_keys( $erasers ); 4286 $eraser_key = $eraser_keys[ $eraser_index - 1 ]; 4287 $eraser = $erasers[ $eraser_key ]; 4286 4288 4287 4289 if ( ! is_array( $eraser ) ) { … … 4305 4307 } 4306 4308 4307 $callback = $eraser s[ $index ]['callback'];4308 $eraser_friendly_name = $eraser s[ $index ]['eraser_friendly_name'];4309 $callback = $eraser['callback']; 4310 $eraser_friendly_name = $eraser['eraser_friendly_name']; 4309 4311 4310 4312 $response = call_user_func( $callback, $email_address, $page ); … … 4397 4399 * 4398 4400 * @param array $response The personal data for the given exporter and page. 4399 * @param int $e xporter_index The index of the exporter that provided this data.4401 * @param int $eraser_index The index of the eraser that provided this data. 4400 4402 * @param string $email_address The email address associated with this personal data. 4401 4403 * @param int $page The page for this response. 4402 4404 * @param int $request_id The privacy request post ID associated with this request. 4405 * @param int $eraser_key The key (slug) of the eraser that provided this data. 4403 4406 */ 4404 $response = apply_filters( 'wp_privacy_personal_data_erasure_page', $response, $eraser_index, $email_address, $page, $request_id );4407 $response = apply_filters( 'wp_privacy_personal_data_erasure_page', $response, $eraser_index, $email_address, $page, $request_id, $eraser_key ); 4405 4408 4406 4409 if ( is_wp_error( $response ) ) { -
branches/4.9/src/wp-admin/includes/file.php
r43119 r43157 2126 2126 * @param int $request_id The request ID for this personal data export. 2127 2127 * @param bool $send_as_email Whether the final results of the export should be emailed to the user. 2128 * @param string $exporter_key The slug (key) of the exporter. 2128 2129 * @return array The filtered response. 2129 2130 */ 2130 function wp_privacy_process_personal_data_export_page( $response, $exporter_index, $email_address, $page, $request_id, $send_as_email ) {2131 function wp_privacy_process_personal_data_export_page( $response, $exporter_index, $email_address, $page, $request_id, $send_as_email, $exporter_key ) { 2131 2132 /* Do some simple checks on the shape of the response from the exporter. 2132 2133 * If the exporter response is malformed, don't attempt to consume it - let it -
branches/4.9/src/wp-includes/comment.php
r43127 r43157 3170 3170 */ 3171 3171 function wp_register_comment_personal_data_exporter( $exporters ) { 3172 $exporters[ ] = array(3172 $exporters['wordpress-comments'] = array( 3173 3173 'exporter_friendly_name' => __( 'WordPress Comments' ), 3174 3174 'callback' => 'wp_comments_personal_data_exporter', … … 3275 3275 */ 3276 3276 function wp_register_comment_personal_data_eraser( $erasers ) { 3277 $erasers[ ] = array(3277 $erasers['wordpress-comments'] = array( 3278 3278 'eraser_friendly_name' => __( 'WordPress Comments' ), 3279 3279 'callback' => 'wp_comments_personal_data_eraser', … … 3383 3383 ); 3384 3384 } 3385 -
branches/4.9/src/wp-includes/media.php
r43108 r43157 3966 3966 */ 3967 3967 function wp_register_media_personal_data_exporter( $exporters ) { 3968 $exporters[ ] = array(3968 $exporters['wordpress-media'] = array( 3969 3969 'exporter_friendly_name' => __( 'WordPress Media' ), 3970 3970 'callback' => 'wp_media_personal_data_exporter', -
branches/4.9/src/wp-includes/user.php
r43119 r43157 2757 2757 */ 2758 2758 function wp_register_user_personal_data_exporter( $exporters ) { 2759 $exporters[ ] = array(2759 $exporters['wordpress-user'] = array( 2760 2760 'exporter_friendly_name' => __( 'WordPress User' ), 2761 2761 'callback' => 'wp_user_personal_data_exporter',
Note: See TracChangeset
for help on using the changeset viewer.