Making WordPress.org


Ignore:
Timestamp:
12/03/2017 07:52:05 PM (9 years ago)
Author:
Otto42
Message:

Plugins: Add commenter user information, for completeness

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php

    r6218 r6219  
    335335         */
    336336        private function audit_log( $message, $post_id ) {
     337                $user = wp_get_current_user();
     338
    337339                $comment = array(
    338                         'comment_type'    => 'audit_log',
    339                         'comment_post_ID' => $post_id,
    340                         'user_id'  => get_current_user_id(),
    341                         'comment_content' => $message,
     340                        'comment_author'       => $user->display_name,
     341                        'comment_author_email' => $user->user_email,
     342                        'comment_author_url'   => $user->user_url,     
     343                        'comment_type'         => 'audit_log',
     344                        'comment_post_ID'      => $post_id,
     345                        'user_id'              => get_current_user_id(),
     346                        'comment_content'      => $message,
    342347                );
    343348                wp_insert_comment( $comment );
Note: See TracChangeset for help on using the changeset viewer.