mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-17 22:01:23 +01:00
Privacy: fix docs, formatting, white space, add tests for the personal data from comments exporter.
Props birgire. Merges [42987] to the 4.9 branch. See #43440. Built from https://develop.svn.wordpress.org/branches/4.9@43077 git-svn-id: http://core.svn.wordpress.org/branches/4.9@42906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2f6f41170a
commit
6a3018a7c9
@ -3147,10 +3147,12 @@ function wp_handle_comment_submission( $comment_data ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers the personal data exporter for comments
|
* Registers the personal data exporter for comments.
|
||||||
|
*
|
||||||
|
* @since 4.9.6
|
||||||
*
|
*
|
||||||
* @param array $exporters An array of personal data exporters.
|
* @param array $exporters An array of personal data exporters.
|
||||||
* @return array An array of personal data exporters.
|
* @return array $exporters An array of personal data exporters.
|
||||||
*/
|
*/
|
||||||
function wp_register_comment_personal_data_exporter( $exporters ) {
|
function wp_register_comment_personal_data_exporter( $exporters ) {
|
||||||
$exporters[] = array(
|
$exporters[] = array(
|
||||||
@ -3164,17 +3166,15 @@ function wp_register_comment_personal_data_exporter( $exporters ) {
|
|||||||
/**
|
/**
|
||||||
* Finds and exports personal data associated with an email address from the comments table.
|
* Finds and exports personal data associated with an email address from the comments table.
|
||||||
*
|
*
|
||||||
|
* @since 4.9.6
|
||||||
|
*
|
||||||
* @param string $email_address The comment author email address.
|
* @param string $email_address The comment author email address.
|
||||||
* @param int $page Comment page.
|
* @param int $page Comment page.
|
||||||
* @return array An array of personal data.
|
* @return array $return An array of personal data.
|
||||||
*/
|
*/
|
||||||
function wp_comments_personal_data_exporter( $email_address, $page = 1 ) {
|
function wp_comments_personal_data_exporter( $email_address, $page = 1 ) {
|
||||||
|
|
||||||
// Technically, strtolower isn't necessary since get_comments will match email insensitive
|
// Limit us to 500 comments at a time to avoid timing out.
|
||||||
// But it is a good example for plugin developers whose targets might not be as generous
|
|
||||||
$email_address = trim( strtolower( $email_address ) );
|
|
||||||
|
|
||||||
// Limit us to 500 comments at a time to avoid timing out
|
|
||||||
$number = 500;
|
$number = 500;
|
||||||
$page = (int) $page;
|
$page = (int) $page;
|
||||||
|
|
||||||
@ -3227,7 +3227,10 @@ function wp_comments_personal_data_exporter( $email_address, $page = 1 ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( ! empty( $value ) ) {
|
if ( ! empty( $value ) ) {
|
||||||
$comment_data_to_export[] = array( 'name' => $name, 'value' => $value );
|
$comment_data_to_export[] = array(
|
||||||
|
'name' => $name,
|
||||||
|
'value' => $value,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.9.6-alpha-43076';
|
$wp_version = '4.9.6-alpha-43077';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user