Changeset 13033 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php
- Timestamp:
- 12/08/2023 03:47:14 AM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php
r12991 r13033 142 142 143 143 case 'rejected': 144 $this->save_rejected_reason( $post->ID ); 144 145 $this->rejected( $post->ID, $post ); 145 146 $this->clear_reviewer( $post ); … … 271 272 'slug' => $original_permalink, 272 273 'submission_date' => $submission_date, 274 'reason' => sanitize_key( $_POST['rejection_reason'] ?? '' ) 273 275 ] 274 276 ); 275 // ..and log rejection. 276 if ( $email->send() ) { 277 Tools::audit_log( 'Plugin rejected.', $post_id ); 278 } else { 279 Tools::audit_log( 'Plugin rejected. Email not sent.', $post_id ); 280 } 277 278 $email->send(); 281 279 } 282 280 … … 331 329 } 332 330 333 if ( ! current_user_can( 'plugin_ approve', $post_id ) ) {331 if ( ! current_user_can( 'plugin_close', $post_id ) ) { 334 332 return; 335 333 } … … 341 339 342 340 Tools::audit_log( sprintf( 'Plugin closed. Reason: %s', $close_reason ), $post_id ); 341 } 342 343 /** 344 * Save the reason for rejecting a plugin. 345 * 346 * @param int $post_id Post ID. 347 */ 348 public function save_rejected_reason( $post_id ) { 349 if ( ! isset( $_REQUEST['rejection_reason'] ) ) { 350 return; 351 } 352 353 if ( ! current_user_can( 'plugin_reject', $post_id ) ) { 354 return; 355 } 356 357 $rejection_reason = sanitize_key( $_REQUEST['rejection_reason'] ); 358 359 update_post_meta( $post_id, '_rejection_reason', $rejection_reason ); 360 update_post_meta( $post_id, 'plugin_rejected_date', current_time( 'mysql' ) ); 361 362 Tools::audit_log( sprintf( 'Plugin rejected. Reason: %s', $rejection_reason ), $post_id ); 343 363 } 344 364
Note: See TracChangeset
for help on using the changeset viewer.