Changeset 9682 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php
- Timestamp:
- 04/02/2020 02:23:28 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php
r9094 r9682 280 280 ); 281 281 282 $this->audit_log( 'Plugin approved.', $post_id );282 Tools::audit_log( 'Plugin approved.', $post_id ); 283 283 wp_mail( $plugin_author->user_email, $subject, $content, 'From: plugins@wordpress.org' ); 284 284 } … … 322 322 ); 323 323 324 $this->audit_log( 'Plugin rejected.', $post_id );324 Tools::audit_log( 'Plugin rejected.', $post_id ); 325 325 wp_mail( $email, $subject, $content, 'From: plugins@wordpress.org' ); 326 326 } … … 362 362 $post = get_post( $post_id ); 363 363 if ( $post && 'approved' != $post->post_status ) { 364 $this->audit_log( 'Plugin reopened.', $post_id );364 Tools::audit_log( 'Plugin reopened.', $post_id ); 365 365 } 366 366 } … … 385 385 update_post_meta( $post_id, 'plugin_closed_date', current_time( 'mysql' ) ); 386 386 387 $this->audit_log( sprintf( 'Plugin closed. Reason: %s', $close_reason ), $post_id );387 Tools::audit_log( sprintf( 'Plugin closed. Reason: %s', $close_reason ), $post_id ); 388 388 } 389 389 … … 406 406 $new_owner = get_userdata( $post_after->post_author ); 407 407 408 $this->audit_log( sprintf(408 Tools::audit_log( sprintf( 409 409 'Ownership transferred to <a href="%s">%s</a>.', 410 esc_url( ' //profiles.wordpress.org/' . $new_owner->user_nicename),410 esc_url( 'https://profiles.wordpress.org/' . $new_owner->user_nicename .'/' ), 411 411 $new_owner->user_login 412 412 ), $post_id ); 413 413 } 414 414 415 /**416 * Saves an audit_log comment for the plugin.417 *418 * @param string $message The message for the audit log.419 * @param integer $post_id The Post ID.420 */421 public function audit_log( $message, $post_id ) {422 $user = wp_get_current_user();423 424 $comment = array(425 'comment_author' => $user->display_name,426 'comment_author_email' => $user->user_email,427 'comment_author_url' => $user->user_url,428 'comment_type' => 'internal-note',429 'comment_post_ID' => $post_id,430 'user_id' => get_current_user_id(),431 'comment_content' => $message,432 );433 wp_insert_comment( $comment );434 }435 415 }
Note: See TracChangeset
for help on using the changeset viewer.