Making WordPress.org

Changeset 5729


Ignore:
Timestamp:
08/02/2017 03:24:38 AM (8 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Remove 'Stick' link for non-public topics.

See #2795.

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-moderators.php

    r5710 r5729  
    395395        }
    396396
     397        // Remove 'Stick' link for reviews or non-public topics.
     398        if ( Plugin::REVIEWS_FORUM_ID == bbp_get_topic_forum_id( $post_id ) || ! bbp_is_topic_public( $post_id ) ) {
     399            unset( $r['stick'] );
     400        }
     401
    397402        // Add 'Archive' link.
    398403        $r['archive'] = $this->get_archive_link( array( 'post_id' => $post_id ) );
     
    415420        unset( $actions['unapproved'] );
    416421
    417         // Remove 'Stick' link for reviews.
    418         if ( Plugin::REVIEWS_FORUM_ID == $post->post_parent ) {
     422        // Remove 'Stick' link for reviews or non-public topics.
     423        if ( Plugin::REVIEWS_FORUM_ID == bbp_get_topic_forum_id( $post->ID ) || ! bbp_is_topic_public( $post->ID ) ) {
    419424            unset( $actions['stick'] );
    420425        }
    421        
    422426
    423427        return $actions;
     
    503507                } else {
    504508                    bbp_unstick_topic( $post->ID );
    505                 }
     509                        }
    506510
    507511                return true;
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-stickies-compat.php

    r5728 r5729  
    151151        }
    152152        $user_id = get_current_user_id();
    153         if ( Plugin::REVIEWS_FORUM_ID != bbp_get_topic_forum_id()
    154             &&
    155             $this->user_can_stick( $user_id, $this->term->term_id, $topic_id )
    156         ) {
     153        if ( isset( $r['stick'] ) && $this->user_can_stick( $user_id, $this->term->term_id, $topic_id ) ) {
    157154            $r['stick'] = self::get_stick_link( array( 'topic_id' => $topic_id, 'term_id' => $this->term->term_id ) );
    158155        } else {
Note: See TracChangeset for help on using the changeset viewer.