Making WordPress.org


Ignore:
Timestamp:
02/22/2017 08:11:40 PM (9 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Store moderator's username on approve/unapprove and archive/unarchive actions.

See #2474.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php

    r4974 r4987  
    4040        add_action( 'bbp_new_reply',  array( $this, 'handle_extra_reply_actions' ), 10, 2 );
    4141        add_action( 'bbp_edit_reply', array( $this, 'handle_extra_reply_actions' ), 10, 2 );
     42
     43        // Store moderator's username on approve/unapprove actions.
     44        add_action( 'bbp_approved_topic',   array( $this, 'store_moderator_username' ) );
     45        add_action( 'bbp_approved_reply',   array( $this, 'store_moderator_username' ) );
     46        add_action( 'bbp_unapproved_topic', array( $this, 'store_moderator_username' ) );
     47        add_action( 'bbp_unapproved_reply', array( $this, 'store_moderator_username' ) );
    4248    }
    4349
     
    267273    }
    268274
     275    /**
     276     * Store moderator's username on approve/unapprove actions.
     277     *
     278     * @param int $post_id Post ID.
     279     */
     280    public function store_moderator_username( $post_id ) {
     281        update_post_meta( $post_id, '_wporg_bbp_moderator', wp_get_current_user()->user_login );
     282    }
     283
    269284}
Note: See TracChangeset for help on using the changeset viewer.