Make WordPress Core


Ignore:
Timestamp:
05/03/2018 07:37:32 PM (7 years ago)
Author:
azaozz
Message:

Privacy: Store plugin callbacks in associative array for flexibility.

The personal data export and erasure tools allow plugins to register their own callbacks, in order to add additional data to the export and erasure processes. Previously, these were registered without specifying a constant identifier in the array of callbacks. Using mutable integers makes it difficult for plugins to modify the callbacks of other plugins, though.

Using associative array keys instead provides a covenient and reliable way to identify and interact with another plugin's callbacks.

Props desrosj, allendav, ocean90.
Merges [43154] to the 4.9 branch.
Fixes #43931.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-admin/includes/file.php

    r43119 r43157  
    21262126 * @param int    $request_id      The request ID for this personal data export.
    21272127 * @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.
    21282129 * @return array The filtered response.
    21292130 */
    2130 function wp_privacy_process_personal_data_export_page( $response, $exporter_index, $email_address, $page, $request_id, $send_as_email ) {
     2131function wp_privacy_process_personal_data_export_page( $response, $exporter_index, $email_address, $page, $request_id, $send_as_email, $exporter_key ) {
    21312132    /* Do some simple checks on the shape of the response from the exporter.
    21322133     * If the exporter response is malformed, don't attempt to consume it - let it
Note: See TracChangeset for help on using the changeset viewer.