<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[49258] trunk/src/wp-admin/includes: Privacy: Add "Mark as completed" action.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/49258">49258</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/49258","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>helen</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2020-10-20 21:05:34 +0000 (Tue, 20 Oct 2020)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Privacy: Add "Mark as completed" action.

Props garrett-eclipse, ocean90, joostdevalk, mista-flo, helen.
Fixes <a href="https://core.trac.wordpress.org/ticket/46619">#46619</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesclasswpprivacydataexportrequestslisttablephp">trunk/src/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpprivacydataremovalrequestslisttablephp">trunk/src/wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpprivacyrequeststablephp">trunk/src/wp-admin/includes/class-wp-privacy-requests-table.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesclasswpprivacydataexportrequestslisttablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php  2020-10-20 20:17:20 UTC (rev 49257)
+++ trunk/src/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php    2020-10-20 21:05:34 UTC (rev 49258)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,26 +47,57 @@
</span><span class="cx" style="display: block; padding: 0 10px">                /** This filter is documented in wp-admin/includes/ajax-actions.php */
</span><span class="cx" style="display: block; padding: 0 10px">                $exporters       = apply_filters( 'wp_privacy_personal_data_exporters', array() );
</span><span class="cx" style="display: block; padding: 0 10px">                $exporters_count = count( $exporters );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                $status          = $item->status;
</ins><span class="cx" style="display: block; padding: 0 10px">                 $request_id      = $item->ID;
</span><span class="cx" style="display: block; padding: 0 10px">                $nonce           = wp_create_nonce( 'wp-privacy-export-personal-data-' . $request_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $download_data_markup = '<div class="export-personal-data" ' .
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $download_data_markup = '<span class="export-personal-data" ' .
</ins><span class="cx" style="display: block; padding: 0 10px">                         'data-exporters-count="' . esc_attr( $exporters_count ) . '" ' .
</span><span class="cx" style="display: block; padding: 0 10px">                        'data-request-id="' . esc_attr( $request_id ) . '" ' .
</span><span class="cx" style="display: block; padding: 0 10px">                        'data-nonce="' . esc_attr( $nonce ) .
</span><span class="cx" style="display: block; padding: 0 10px">                        '">';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $download_data_markup .= '<span class="export-personal-data-idle"><button type="button" class="button-link export-personal-data-handle">' . __( 'Download Personal Data' ) . '</button></span>' .
-                       '<span class="export-personal-data-processing hidden">' . __( 'Downloading Data...' ) . ' <span class="export-progress"></span></span>' .
-                       '<span class="export-personal-data-success hidden"><button type="button" class="button-link export-personal-data-handle">' . __( 'Download Personal Data Again' ) . '</button></span>' .
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $download_data_markup .= '<span class="export-personal-data-idle"><button type="button" class="button-link export-personal-data-handle">' . __( 'Download personal data' ) . '</button></span>' .
+                       '<span class="export-personal-data-processing hidden">' . __( 'Downloading data...' ) . ' <span class="export-progress"></span></span>' .
+                       '<span class="export-personal-data-success hidden"><button type="button" class="button-link export-personal-data-handle">' . __( 'Download personal data again' ) . '</button></span>' .
</ins><span class="cx" style="display: block; padding: 0 10px">                         '<span class="export-personal-data-failed hidden">' . __( 'Download failed.' ) . ' <button type="button" class="button-link">' . __( 'Retry' ) . '</button></span>';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $download_data_markup .= '</div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $download_data_markup .= '</span>';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $row_actions = array(
-                       'download-data' => $download_data_markup,
-               );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $row_actions['download-data'] = $download_data_markup;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                if ( 'request-completed' !== $status ) {
+                       $complete_request_markup  = '<span>';
+                       $complete_request_markup .= sprintf(
+                               '<a href="%s" class="complete-request" aria-label="%s">%s</a>',
+                               esc_url(
+                                       wp_nonce_url(
+                                               add_query_arg(
+                                                       array(
+                                                               'action'     => 'complete',
+                                                               'request_id' => array( $request_id ),
+                                                       ),
+                                                       admin_url( 'export-personal-data.php' )
+                                               ),
+                                               'bulk-privacy_requests'
+                                       )
+                               ),
+                               esc_attr(
+                                       sprintf(
+                                               /* translators: %s: Request email. */
+                                               __( 'Mark export request for &#8220;%s&#8221; as completed.' ),
+                                               $item->email
+                                       )
+                               ),
+                               __( 'Complete request' )
+                       );
+                       $complete_request_markup .= '</span>';
+               }
+
+               if ( ! empty ( $complete_request_markup ) ) {
+                       $row_actions['complete-request'] = $complete_request_markup;
+               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 return sprintf( '<a href="%1$s">%2$s</a> %3$s', esc_url( 'mailto:' . $item->email ), $item->email, $this->row_actions( $row_actions ) );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -99,8 +130,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        '">';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                <span class="export-personal-data-idle"><button type="button" class="button-link export-personal-data-handle"><?php _e( 'Send Export Link' ); ?></button></span>
-                               <span class="export-personal-data-processing hidden"><?php _e( 'Sending Email...' ); ?> <span class="export-progress"></span></span>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         <span class="export-personal-data-idle"><button type="button" class="button-link export-personal-data-handle"><?php _e( 'Send export link' ); ?></button></span>
+                               <span class="export-personal-data-processing hidden"><?php _e( 'Sending email...' ); ?> <span class="export-progress"></span></span>
</ins><span class="cx" style="display: block; padding: 0 10px">                                 <span class="export-personal-data-success success-message hidden"><?php _e( 'Email sent.' ); ?></span>
</span><span class="cx" style="display: block; padding: 0 10px">                                <span class="export-personal-data-failed hidden"><?php _e( 'Email could not be sent.' ); ?> <button type="button" class="button-link export-personal-data-handle"><?php _e( 'Retry' ); ?></button></span>
</span><span class="cx" style="display: block; padding: 0 10px">                                <?php
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpprivacydataremovalrequestslisttablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php 2020-10-20 20:17:20 UTC (rev 49257)
+++ trunk/src/wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php   2020-10-20 21:05:34 UTC (rev 49258)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,32 +47,63 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $row_actions = array();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Allow the administrator to "force remove" the personal data even if confirmation has not yet been received.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $status = $item->status;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $status      = $item->status;
+               $request_id  = $item->ID;
+               $row_actions = array();
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( 'request-confirmed' !== $status ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        /** This filter is documented in wp-admin/includes/ajax-actions.php */
</span><span class="cx" style="display: block; padding: 0 10px">                        $erasers       = apply_filters( 'wp_privacy_personal_data_erasers', array() );
</span><span class="cx" style="display: block; padding: 0 10px">                        $erasers_count = count( $erasers );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $request_id    = $item->ID;
</del><span class="cx" style="display: block; padding: 0 10px">                         $nonce         = wp_create_nonce( 'wp-privacy-erase-personal-data-' . $request_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $remove_data_markup = '<div class="remove-personal-data force-remove-personal-data" ' .
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $remove_data_markup = '<span class="remove-personal-data force-remove-personal-data" ' .
</ins><span class="cx" style="display: block; padding: 0 10px">                                 'data-erasers-count="' . esc_attr( $erasers_count ) . '" ' .
</span><span class="cx" style="display: block; padding: 0 10px">                                'data-request-id="' . esc_attr( $request_id ) . '" ' .
</span><span class="cx" style="display: block; padding: 0 10px">                                'data-nonce="' . esc_attr( $nonce ) .
</span><span class="cx" style="display: block; padding: 0 10px">                                '">';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $remove_data_markup .= '<span class="remove-personal-data-idle"><button type="button" class="button-link remove-personal-data-handle">' . __( 'Force Erase Personal Data' ) . '</button></span>' .
-                               '<span class="remove-personal-data-processing hidden">' . __( 'Erasing Data...' ) . ' <span class="erasure-progress"></span></span>' .
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $remove_data_markup .= '<span class="remove-personal-data-idle"><button type="button" class="button-link remove-personal-data-handle">' . __( 'Force erase personal data' ) . '</button></span>' .
+                               '<span class="remove-personal-data-processing hidden">' . __( 'Erasing data...' ) . ' <span class="erasure-progress"></span></span>' .
</ins><span class="cx" style="display: block; padding: 0 10px">                                 '<span class="remove-personal-data-success hidden">' . __( 'Erasure completed.' ) . '</span>' .
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                '<span class="remove-personal-data-failed hidden">' . __( 'Force Erasure has failed.' ) . ' <button type="button" class="button-link remove-personal-data-handle">' . __( 'Retry' ) . '</button></span>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         '<span class="remove-personal-data-failed hidden">' . __( 'Force erasure has failed.' ) . ' <button type="button" class="button-link remove-personal-data-handle">' . __( 'Retry' ) . '</button></span>';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $remove_data_markup .= '</div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $remove_data_markup .= '</span>';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $row_actions = array(
-                               'remove-data' => $remove_data_markup,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $row_actions['remove-data'] = $remove_data_markup;
+               }
+
+               if ( 'request-completed' !== $status ) {
+                       $complete_request_markup  = '<span>';
+                       $complete_request_markup .= sprintf(
+                               '<a href="%s" class="complete-request" aria-label="%s">%s</a>',
+                               esc_url(
+                                       wp_nonce_url(
+                                               add_query_arg(
+                                                       array(
+                                                               'action'     => 'complete',
+                                                               'request_id' => array( $request_id ),
+                                                       ),
+                                                       admin_url( 'erase-personal-data.php' )
+                                               ),
+                                               'bulk-privacy_requests'
+                                       )
+                               ),
+                               esc_attr(
+                                       sprintf(
+                                               /* translators: %s: Request email. */
+                                               __( 'Mark export request for &#8220;%s&#8221; as completed.' ),
+                                               $item->email
+                                       )
+                               ),
+                               __( 'Complete request' )
</ins><span class="cx" style="display: block; padding: 0 10px">                         );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        $complete_request_markup .= '</span>';
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                if ( ! empty ( $complete_request_markup ) ) {
+                       $row_actions['complete-request'] = $complete_request_markup;
+               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 return sprintf( '<a href="%1$s">%2$s</a> %3$s', esc_url( 'mailto:' . $item->email ), $item->email, $this->row_actions( $row_actions ) );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -105,10 +136,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        '">';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                <span class="remove-personal-data-idle"><button type="button" class="button-link remove-personal-data-handle"><?php _e( 'Erase Personal Data' ); ?></button></span>
-                               <span class="remove-personal-data-processing hidden"><?php _e( 'Erasing Data...' ); ?> <span class="erasure-progress"></span></span>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         <span class="remove-personal-data-idle"><button type="button" class="button-link remove-personal-data-handle"><?php _e( 'Erase personal data' ); ?></button></span>
+                               <span class="remove-personal-data-processing hidden"><?php _e( 'Erasing data...' ); ?> <span class="erasure-progress"></span></span>
</ins><span class="cx" style="display: block; padding: 0 10px">                                 <span class="remove-personal-data-success success-message hidden" ><?php _e( 'Erasure completed.' ); ?></span>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                <span class="remove-personal-data-failed hidden"><?php _e( 'Data Erasure has failed.' ); ?> <button type="button" class="button-link remove-personal-data-handle"><?php _e( 'Retry' ); ?></button></span>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         <span class="remove-personal-data-failed hidden"><?php _e( 'Data erasure has failed.' ); ?> <button type="button" class="button-link remove-personal-data-handle"><?php _e( 'Retry' ); ?></button></span>
</ins><span class="cx" style="display: block; padding: 0 10px">                                 <?php
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                echo '</div>';
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpprivacyrequeststablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-privacy-requests-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-privacy-requests-table.php   2020-10-20 20:17:20 UTC (rev 49257)
+++ trunk/src/wp-admin/includes/class-wp-privacy-requests-table.php     2020-10-20 21:05:34 UTC (rev 49258)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,7 +43,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'email'             => __( 'Requester' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'status'            => __( 'Status' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'created_timestamp' => __( 'Requested' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'next_steps'        => __( 'Next Steps' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'next_steps'        => __( 'Next steps' ),
</ins><span class="cx" style="display: block; padding: 0 10px">                 );
</span><span class="cx" style="display: block; padding: 0 10px">                return $columns;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -210,8 +210,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        protected function get_bulk_actions() {
</span><span class="cx" style="display: block; padding: 0 10px">                return array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'delete' => __( 'Delete Requests' ),
-                       'resend' => __( 'Resend Confirmation Requests' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'resend'   => __( 'Resend confirmation requests' ),
+                       'complete' => __( 'Mark requests as completed' ),
+                       'delete'   => __( 'Delete requests' ),
</ins><span class="cx" style="display: block; padding: 0 10px">                 );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -219,6 +220,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * Process bulk actions.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 4.9.6
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * @since 5.6.0 Added support for the `complete` action.
</ins><span class="cx" style="display: block; padding: 0 10px">          */
</span><span class="cx" style="display: block; padding: 0 10px">        public function process_bulk_action() {
</span><span class="cx" style="display: block; padding: 0 10px">                $action      = $this->current_action();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -231,10 +233,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                switch ( $action ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        case 'delete':
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 case 'resend':
</ins><span class="cx" style="display: block; padding: 0 10px">                                 foreach ( $request_ids as $request_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        if ( wp_delete_post( $request_id, true ) ) {
-                                               $count ++;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 $resend = _wp_privacy_resend_request( $request_id );
+
+                                       if ( $resend && ! is_wp_error( $resend ) ) {
+                                               $count++;
</ins><span class="cx" style="display: block; padding: 0 10px">                                         }
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -242,15 +246,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        'bulk_action',
</span><span class="cx" style="display: block; padding: 0 10px">                                        'bulk_action',
</span><span class="cx" style="display: block; padding: 0 10px">                                        /* translators: %d: Number of requests. */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        sprintf( _n( 'Deleted %d request.', 'Deleted %d requests.', $count ), $count ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 sprintf( _n( 'Re-sent %d request.', 'Re-sent %d requests.', $count ), $count ),
</ins><span class="cx" style="display: block; padding: 0 10px">                                         'success'
</span><span class="cx" style="display: block; padding: 0 10px">                                );
</span><span class="cx" style="display: block; padding: 0 10px">                                break;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        case 'resend':
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 case 'complete':
</ins><span class="cx" style="display: block; padding: 0 10px">                                 foreach ( $request_ids as $request_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        $resend = _wp_privacy_resend_request( $request_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 $result = _wp_privacy_completed_request( $request_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        if ( $resend && ! is_wp_error( $resend ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 if ( $result && ! is_wp_error( $result ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                                 $count++;
</span><span class="cx" style="display: block; padding: 0 10px">                                        }
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -259,10 +263,25 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        'bulk_action',
</span><span class="cx" style="display: block; padding: 0 10px">                                        'bulk_action',
</span><span class="cx" style="display: block; padding: 0 10px">                                        /* translators: %d: Number of requests. */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        sprintf( _n( 'Re-sent %d request.', 'Re-sent %d requests.', $count ), $count ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 sprintf( _n( '%d request marked as complete.', '%d requests marked as complete.', $count ), $count ),
</ins><span class="cx" style="display: block; padding: 0 10px">                                         'success'
</span><span class="cx" style="display: block; padding: 0 10px">                                );
</span><span class="cx" style="display: block; padding: 0 10px">                                break;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        case 'delete':
+                               foreach ( $request_ids as $request_id ) {
+                                       if ( wp_delete_post( $request_id, true ) ) {
+                                               $count ++;
+                                       }
+                               }
+
+                               add_settings_error(
+                                       'bulk_action',
+                                       'bulk_action',
+                                       /* translators: %d: Number of requests. */
+                                       sprintf( _n( 'Deleted %d request.', 'Deleted %d requests.', $count ), $count ),
+                                       'success'
+                               );
+                               break;
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre>
</div>
</div>

</body>
</html>