WordPress.org

Making WordPress.org

Changeset 4235


Ignore:
Timestamp:
10/14/2016 02:57:17 AM (3 years ago)
Author:
jmdodd
Message:

Support Forums: Allow plugin contributors to mark a topic as resolved.

See #1413.

File:
1 edited

Legend:

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

    r4121 r4235  
    253253
    254254    /**
    255      * Allow plugin/theme authors to resolve a topic on their support forum.
     255     * Allow plugin/theme authors and contributors to resolve a topic on their support forum.
    256256     *
    257257     * @param bool $retval If the user can set a topic resolution for the topic
     
    262262    public function user_can_resolve( $retval, $user_id, $topic_id ) {
    263263        $user = get_userdata( $user_id );
    264         if ( $user && ! empty( $this->authors ) && in_array( $user->user_login, $this->authors ) ) {
     264        if ( ! $user ) {
     265            return $retval;
     266        }
     267        if (
     268            ( ! empty( $this->authors ) && in_array( $user->user_login, $this->authors ) )
     269        ||
     270            ( ! empty( $this->contributors ) && in_array( $user->user_login, $this->contributors ) )
     271        ) {
    265272            $retval = true;
    266273        }
Note: See TracChangeset for help on using the changeset viewer.