Making WordPress.org

Ticket #2590: 2590.3.diff

File 2590.3.diff, 2.1 KB (added by SergeyBiryukov, 9 years ago)
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-topic-resolution/inc/class-plugin.php

     
    505505                        $post = get_post( $topic_id );
    506506                }
    507507
    508                 if ( $user_id && $post && ( user_can( $user_id, 'moderate' ) || $user_id == $post->post_author ) ) {
     508                if ( $user_id && $post && ( user_can( $user_id, 'moderate', $topic_id ) || $user_id == $post->post_author ) ) {
    509509                        $retval = true;
    510510                } else {
    511511                        $retval = false;
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-user-badges/inc/class-plugin.php

     
    386386         * of badging them. Use the $strict argument to check that the user is a
    387387         * moderator without considering if they are a keymaster.
    388388         *
    389          * @param string $user_id Optional. User ID. Assumes current reply author ID
     389         * @param string $user_id Optional. User ID. Assumes current post author ID
    390390         *                        if not provided.
    391391         * @param bool   $strict  Optional. True if user should strictly be checked
    392392         *                        for being a moderator, false will also check if they
     
    395395         */
    396396        public function is_user_moderator( $user_id = '', $strict = false ) {
    397397                if ( ! $user_id ) {
    398                         $user_id = bbp_get_reply_author_id();
     398                        $user_id = get_post_field( 'post_author' );
    399399                }
    400400
    401                 return ( user_can( $user_id, 'moderate' ) || ( ! $strict && bbp_is_user_keymaster( $user_id ) ) );
     401                return ( user_can( $user_id, 'moderate', get_the_ID() ) || ( ! $strict && bbp_is_user_keymaster( $user_id ) ) );
    402402        }
    403403}