Changeset 49331
- Timestamp:
- 10/27/2020 05:45:29 PM (4 years ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-privacy-requests-table.php
r49258 r49331 227 227 $request_ids = isset( $_REQUEST['request_id'] ) ? wp_parse_id_list( wp_unslash( $_REQUEST['request_id'] ) ) : array(); 228 228 229 $count = 0; 230 231 if ( $request_ids ) { 232 check_admin_referer( 'bulk-privacy_requests' ); 233 } 229 if ( empty( $request_ids ) ) { 230 return; 231 } 232 233 $count = 0; 234 $failures = 0; 235 236 check_admin_referer( 'bulk-privacy_requests' ); 234 237 235 238 switch ( $action ) { … … 240 243 if ( $resend && ! is_wp_error( $resend ) ) { 241 244 $count++; 245 } else { 246 $failures++; 247 } 248 } 249 250 if ( $count ) { 251 add_settings_error( 252 'bulk_action', 253 'bulk_action', 254 sprintf( 255 /* translators: %d: Number of requests. */ 256 _n( 257 '%d confirmation request re-sent successfully.', 258 '%d confirmation requests re-sent successfully.', 259 $count 260 ), 261 $count 262 ), 263 'success' 264 ); 265 } 266 267 if ( $failures ) { 268 add_settings_error( 269 'bulk_action', 270 'bulk_action', 271 sprintf( 272 /* translators: %d: Number of requests. */ 273 _n( 274 '%d confirmation request failed to resend.', 275 '%d confirmation requests failed to resend.', 276 $failures 277 ), 278 $failures 279 ), 280 'error' 281 ); 282 } 283 284 break; 285 286 case 'complete': 287 foreach ( $request_ids as $request_id ) { 288 $result = _wp_privacy_completed_request( $request_id ); 289 290 if ( $result && ! is_wp_error( $result ) ) { 291 $count++; 242 292 } 243 293 } … … 246 296 'bulk_action', 247 297 'bulk_action', 248 /* translators: %d: Number of requests. */ 249 sprintf( _n( 'Re-sent %d request.', 'Re-sent %d requests.', $count ), $count ), 298 sprintf( 299 /* translators: %d: Number of requests. */ 300 _n( 301 '%d request marked as complete.', 302 '%d requests marked as complete.', 303 $count 304 ), 305 $count 306 ), 250 307 'success' 251 308 ); 252 309 break; 253 case 'complete': 254 foreach ( $request_ids as $request_id ) { 255 $result = _wp_privacy_completed_request( $request_id ); 256 257 if ( $result && ! is_wp_error( $result ) ) { 258 $count++; 259 } 260 } 261 262 add_settings_error( 263 'bulk_action', 264 'bulk_action', 265 /* translators: %d: Number of requests. */ 266 sprintf( _n( '%d request marked as complete.', '%d requests marked as complete.', $count ), $count ), 267 'success' 268 ); 269 break; 310 270 311 case 'delete': 271 312 foreach ( $request_ids as $request_id ) { 272 313 if ( wp_delete_post( $request_id, true ) ) { 273 $count ++; 314 $count++; 315 } else { 316 $failures++; 274 317 } 275 318 } 276 319 277 add_settings_error( 278 'bulk_action', 279 'bulk_action', 280 /* translators: %d: Number of requests. */ 281 sprintf( _n( 'Deleted %d request.', 'Deleted %d requests.', $count ), $count ), 282 'success' 283 ); 320 if ( $failures ) { 321 add_settings_error( 322 'bulk_action', 323 'bulk_action', 324 sprintf( 325 /* translators: %d: Number of requests. */ 326 _n( 327 '%d request failed to delete.', 328 '%d requests failed to delete.', 329 $failures 330 ), 331 $failures 332 ), 333 'error' 334 ); 335 } 336 337 if ( $count ) { 338 add_settings_error( 339 'bulk_action', 340 'bulk_action', 341 sprintf( 342 /* translators: %d: Number of requests. */ 343 _n( 344 '%d request deleted successfully.', 345 '%d requests deleted successfully.', 346 $count 347 ), 348 $count 349 ), 350 'success' 351 ); 352 } 353 284 354 break; 285 355 } -
trunk/src/wp-admin/includes/privacy-tools.php
r49090 r49331 14 14 * 15 15 * @param int $request_id Request ID. 16 * @return bool|WP_Error Returns true /false based on the success of sending the email, or a WP_Error object.16 * @return bool|WP_Error Returns true if sending the email was successful, or a WP_Error object. 17 17 */ 18 18 function _wp_privacy_resend_request( $request_id ) {
Note: See TracChangeset
for help on using the changeset viewer.