Summery Summery
Process bulk actions.
Syntax Syntax
Source Source
File: wp-admin/includes/class-wp-privacy-requests-table.php
* Process bulk actions.
*
* @since 4.9.6
*/
public function process_bulk_action() {
$action = $this->current_action();
$request_ids = isset( $_REQUEST['request_id'] ) ? wp_parse_id_list( wp_unslash( $_REQUEST['request_id'] ) ) : array();
$count = 0;
if ( $request_ids ) {
check_admin_referer( 'bulk-privacy_requests' );
}
switch ( $action ) {
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;
case 'resend':
foreach ( $request_ids as $request_id ) {
$resend = _wp_privacy_resend_request( $request_id );
if ( $resend && ! is_wp_error( $resend ) ) {
$count++;
}
}
add_settings_error(
'bulk_action',
'bulk_action',
/* translators: %d: Number of requests. */
sprintf( _n( 'Re-sent %d request', 'Re-sent %d requests', $count ), $count ),
'success'
Advertisement
Changelog Changelog
| Version | Description |
|---|---|
| 4.9.6 | Introduced. |