Make WordPress Core


Ignore:
Timestamp:
05/03/2018 07:27:14 PM (7 years ago)
Author:
iandunn
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.
Fixes #43931.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r43135 r43154  
    41034103 */
    41044104function wp_register_media_personal_data_exporter( $exporters ) {
    4105     $exporters[] = array(
     4105    $exporters['wordpress-media'] = array(
    41064106        'exporter_friendly_name' => __( 'WordPress Media' ),
    41074107        'callback'               => 'wp_media_personal_data_exporter',
Note: See TracChangeset for help on using the changeset viewer.