Making WordPress.org

Changeset 5291


Ignore:
Timestamp:
04/09/2017 05:34:20 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Move Hooks::store_moderator_username() method added in [4987] to Moderators class.

See #2474.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc
Files:
2 edited

Legend:

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

    r5280 r5291  
    4848        // Honor i18n number formatting.
    4949        add_filter( 'bbp_number_format', array( $this, 'number_format_i18n' ), 10, 5 );
    50 
    51         // Store moderator's username on approve/unapprove actions.
    52         add_action( 'bbp_approved_topic',   array( $this, 'store_moderator_username' ) );
    53         add_action( 'bbp_approved_reply',   array( $this, 'store_moderator_username' ) );
    54         add_action( 'bbp_unapproved_topic', array( $this, 'store_moderator_username' ) );
    55         add_action( 'bbp_unapproved_reply', array( $this, 'store_moderator_username' ) );
    5650    }
    5751
     
    375369        return $formatted_number;
    376370    }
    377    
    378     /**
    379      * Store moderator's username on approve/unapprove actions.
    380      *
    381      * @param int $post_id Post ID.
    382      */
    383     public function store_moderator_username( $post_id ) {
    384         update_post_meta( $post_id, '_wporg_bbp_moderator', wp_get_current_user()->user_login );
    385     }
    386 
    387371}
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-moderators.php

    r5290 r5291  
    4444        add_filter( 'bbp_get_reply_spam_link',          array( $this, 'convert_toggles_to_actions' ), 10, 3 );
    4545        add_filter( 'bbp_get_reply_approve_link',       array( $this, 'convert_toggles_to_actions' ), 10, 3 );
     46
     47        // Store moderator's username on approve/unapprove actions.
     48        add_action( 'bbp_approved_topic',               array( $this, 'store_moderator_username' ) );
     49        add_action( 'bbp_approved_reply',               array( $this, 'store_moderator_username' ) );
     50        add_action( 'bbp_unapproved_topic',             array( $this, 'store_moderator_username' ) );
     51        add_action( 'bbp_unapproved_reply',             array( $this, 'store_moderator_username' ) );
    4652    }
    4753
     
    571577        return $link;
    572578    }
     579
     580    /**
     581     * Store moderator's username on approve/unapprove actions.
     582     *
     583     * @param int $post_id Post ID.
     584     */
     585    public function store_moderator_username( $post_id ) {
     586        update_post_meta( $post_id, self::MODERATOR_META, wp_get_current_user()->user_login );
     587    }
    573588}
Note: See TracChangeset for help on using the changeset viewer.