Skip to content

Commit 7c254c5

Browse files
committed
Privacy: Improve docblocks for hooks and functions related to personal data export and erasure.
See #58833 git-svn-id: https://develop.svn.wordpress.org/trunk@56482 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 03290de commit 7c254c5

4 files changed

Lines changed: 46 additions & 17 deletions

File tree

src/wp-admin/includes/ajax-actions.php

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4939,8 +4939,8 @@ function wp_ajax_wp_privacy_export_personal_data() {
49394939
* Array of personal data exporters.
49404940
*
49414941
* @type callable $callback Callable exporter function that accepts an
4942-
* email address and a page and returns an array
4943-
* of name => value pairs of personal data.
4942+
* email address and a page number and returns an
4943+
* array of name => value pairs of personal data.
49444944
* @type string $exporter_friendly_name Translated user facing friendly name for the
49454945
* exporter.
49464946
* }
@@ -5051,10 +5051,10 @@ function wp_ajax_wp_privacy_export_personal_data() {
50515051
*
50525052
* @since 4.9.6
50535053
*
5054-
* @param array $response The personal data for the given exporter and page.
5054+
* @param array $response The personal data for the given exporter and page number.
50555055
* @param int $exporter_index The index of the exporter that provided this data.
50565056
* @param string $email_address The email address associated with this personal data.
5057-
* @param int $page The page for this response.
5057+
* @param int $page The page number for this response.
50585058
* @param int $request_id The privacy request post ID associated with this request.
50595059
* @param bool $send_as_email Whether the final results of the export should be emailed to the user.
50605060
* @param string $exporter_key The key (slug) of the exporter that provided this data.
@@ -5128,8 +5128,8 @@ function wp_ajax_wp_privacy_erase_personal_data() {
51285128
* @type array ...$0 {
51295129
* Array of personal data exporters.
51305130
*
5131-
* @type callable $callback Callable eraser that accepts an email address and
5132-
* a page and returns an array with boolean values for
5131+
* @type callable $callback Callable eraser that accepts an email address and a page
5132+
* number, and returns an array with boolean values for
51335133
* whether items were removed or retained and any messages
51345134
* from the eraser, as well as if additional pages are
51355135
* available.
@@ -5281,10 +5281,17 @@ function wp_ajax_wp_privacy_erase_personal_data() {
52815281
*
52825282
* @since 4.9.6
52835283
*
5284-
* @param array $response The personal data for the given exporter and page.
5284+
* @param array $response {
5285+
* The personal data for the given exporter and page number.
5286+
*
5287+
* @type bool $items_removed Whether items were actually removed or not.
5288+
* @type bool $items_retained Whether items were retained or not.
5289+
* @type string[] $messages An array of messages to add to the personal data export file.
5290+
* @type bool $done Whether the eraser is finished or not.
5291+
* }
52855292
* @param int $eraser_index The index of the eraser that provided this data.
52865293
* @param string $email_address The email address associated with this personal data.
5287-
* @param int $page The page for this response.
5294+
* @param int $page The page number for this response.
52885295
* @param int $request_id The privacy request post ID associated with this request.
52895296
* @param string $eraser_key The key (slug) of the eraser that provided this data.
52905297
*/

src/wp-includes/comment.php

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3684,8 +3684,8 @@ function wp_handle_comment_submission( $comment_data ) {
36843684
*
36853685
* @since 4.9.6
36863686
*
3687-
* @param array $exporters An array of personal data exporters.
3688-
* @return array An array of personal data exporters.
3687+
* @param array[] $exporters An array of personal data exporters.
3688+
* @return array[] An array of personal data exporters.
36893689
*/
36903690
function wp_register_comment_personal_data_exporter( $exporters ) {
36913691
$exporters['wordpress-comments'] = array(
@@ -3702,8 +3702,13 @@ function wp_register_comment_personal_data_exporter( $exporters ) {
37023702
* @since 4.9.6
37033703
*
37043704
* @param string $email_address The comment author email address.
3705-
* @param int $page Comment page.
3706-
* @return array An array of personal data.
3705+
* @param int $page Comment page number.
3706+
* @return array {
3707+
* An array of personal data.
3708+
*
3709+
* @type array[] $data An array of personal data arrays.
3710+
* @type bool $done Whether the exporter is finished.
3711+
* }
37073712
*/
37083713
function wp_comments_personal_data_exporter( $email_address, $page = 1 ) {
37093714
// Limit us to 500 comments at a time to avoid timing out.
@@ -3814,8 +3819,15 @@ function wp_register_comment_personal_data_eraser( $erasers ) {
38143819
* @global wpdb $wpdb WordPress database abstraction object.
38153820
*
38163821
* @param string $email_address The comment author email address.
3817-
* @param int $page Comment page.
3818-
* @return array
3822+
* @param int $page Comment page number.
3823+
* @return array {
3824+
* Data removal results.
3825+
*
3826+
* @type bool $items_removed Whether items were actually removed.
3827+
* @type bool $items_retained Whether items were retained.
3828+
* @type string[] $messages An array of messages to add to the personal data export file.
3829+
* @type bool $done Whether the eraser is finished.
3830+
* }
38193831
*/
38203832
function wp_comments_personal_data_eraser( $email_address, $page = 1 ) {
38213833
global $wpdb;

src/wp-includes/media.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5359,8 +5359,13 @@ function wp_register_media_personal_data_exporter( $exporters ) {
53595359
* @since 4.9.6
53605360
*
53615361
* @param string $email_address The attachment owner email address.
5362-
* @param int $page Attachment page.
5363-
* @return array An array of personal data.
5362+
* @param int $page Attachment page number.
5363+
* @return array {
5364+
* An array of personal data.
5365+
*
5366+
* @type array[] $data An array of personal data arrays.
5367+
* @type bool $done Whether the exporter is finished.
5368+
* }
53645369
*/
53655370
function wp_media_personal_data_exporter( $email_address, $page = 1 ) {
53665371
// Limit us to 50 attachments at a time to avoid timing out.

src/wp-includes/user.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3807,7 +3807,12 @@ function wp_register_user_personal_data_exporter( $exporters ) {
38073807
* @since 5.4.0 Added 'Session Tokens' group to the export data.
38083808
*
38093809
* @param string $email_address The user's email address.
3810-
* @return array An array of personal data.
3810+
* @return array {
3811+
* An array of personal data.
3812+
*
3813+
* @type array[] $data An array of personal data arrays.
3814+
* @type bool $done Whether the exporter is finished.
3815+
* }
38113816
*/
38123817
function wp_user_personal_data_exporter( $email_address ) {
38133818
$email_address = trim( $email_address );

0 commit comments

Comments
 (0)