Making WordPress.org

Changeset 5002


Ignore:
Timestamp:
02/24/2017 07:31:14 PM (5 years ago)
Author:
coffee2code
Message:

Support Forums, User Moderation: Record user_nicename of moderator who flags/unflags a user.

Props SergeyBiryukov.
See #2493.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-user-moderation/inc/class-plugin.php

    r4873 r5002  
    1919    // Back-compat user option name.
    2020    const USER_META = 'is_bozo';
     21
     22    // Meta key to store moderator's username on flag/unflag actions.
     23    const MODERATOR_META = '_wporg_bbp_moderator';
    2124
    2225    /**
     
    229232        if ( ! $this->is_user_flagged( $user_id ) ) {
    230233            update_user_meta( $user_id, self::USER_META, true );
     234            update_user_meta( $user_id, self::MODERATOR_META, wp_get_current_user()->user_nicename );
    231235        }
    232236        do_action( 'wporg_bbp_flag_user', $user_id );
     
    242246        if ( $this->is_user_flagged( $user_id ) ) {
    243247            delete_user_meta( $user_id, self::USER_META );
     248            update_user_meta( $user_id, self::MODERATOR_META, wp_get_current_user()->user_nicename );
    244249        }
    245250        do_action( 'wporg_bbp_unflag_user', $user_id );
Note: See TracChangeset for help on using the changeset viewer.