mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 18:54:29 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@43154 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3285,7 +3285,7 @@ function wp_handle_comment_submission( $comment_data ) {
|
||||
* @return array $exporters An array of personal data exporters.
|
||||
*/
|
||||
function wp_register_comment_personal_data_exporter( $exporters ) {
|
||||
$exporters[] = array(
|
||||
$exporters['wordpress-comments'] = array(
|
||||
'exporter_friendly_name' => __( 'WordPress Comments' ),
|
||||
'callback' => 'wp_comments_personal_data_exporter',
|
||||
);
|
||||
@@ -3390,7 +3390,7 @@ function wp_comments_personal_data_exporter( $email_address, $page = 1 ) {
|
||||
* @return array $erasers An array of personal data erasers.
|
||||
*/
|
||||
function wp_register_comment_personal_data_eraser( $erasers ) {
|
||||
$erasers[] = array(
|
||||
$erasers['wordpress-comments'] = array(
|
||||
'eraser_friendly_name' => __( 'WordPress Comments' ),
|
||||
'callback' => 'wp_comments_personal_data_eraser',
|
||||
);
|
||||
@@ -3498,4 +3498,3 @@ function wp_comments_personal_data_eraser( $email_address, $page = 1 ) {
|
||||
'done' => $done,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user