Making WordPress.org

Changeset 5749


Ignore:
Timestamp:
08/04/2017 02:36:57 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Amend [5729] to make sure plugin/theme authors and contributors still have the 'Stick' link when appropriate.

See #2795.

File:
1 edited

Legend:

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

    r5731 r5749  
    155155            return $r;
    156156        }
     157
    157158        $user_id = get_current_user_id();
    158         if ( isset( $r['stick'] ) && $this->user_can_stick( $user_id, $this->term->term_id, $topic_id ) ) {
     159
     160        if (
     161            Plugin::REVIEWS_FORUM_ID != bbp_get_topic_forum_id()
     162        &&
     163            in_array( get_post_status( $topic_id ), array( 'publish', 'closed' ) )
     164        &&
     165            $this->user_can_stick( $user_id, $this->term->term_id, $topic_id )
     166        ) {
    159167            $r['stick'] = self::get_stick_link( array( 'topic_id' => $topic_id, 'term_id' => $this->term->term_id ) );
    160168        } else {
Note: See TracChangeset for help on using the changeset viewer.