WordPress.org

Making WordPress.org

Changeset 4958


Ignore:
Timestamp:
02/20/2017 10:56:05 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Allow plugin contributors to stick a thread within an individual plugin's forum.

Fixes #1413.

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-directory-compat.php

    r4948 r4958  
    244244                // Instantiate WPORG_Stickies mode for topic view.
    245245                if ( class_exists( 'WordPressdotorg\Forums\Stickies_Compat' ) ) {
    246                     $this->stickies = new Stickies_Compat( $this->compat(), $this->slug(), $this->taxonomy(), $this->get_object( $this->slug() ), $this->term, $this->authors );
     246                    $this->stickies = new Stickies_Compat( $this->compat(), $this->slug(), $this->taxonomy(), $this->get_object( $this->slug() ), $this->term, $this->authors, $this->contributors );
    247247                }
    248248
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-stickies-compat.php

    r4161 r4958  
    1313    var $term     = null;
    1414
    15     public function __construct( $compat, $slug, $taxonomy, $object, $term, $authors = array() ) {
     15    public function __construct( $compat, $slug, $taxonomy, $object, $term, $authors = array(), $contributors = array() ) {
    1616        if ( empty( $compat ) || empty( $slug ) || empty( $taxonomy ) || empty( $object ) || empty( $term ) ) {
    1717            return;
    1818        }
    1919
    20         $this->compat   = $compat;
    21         $this->slug     = $slug;
    22         $this->taxonomy = $taxonomy;
    23         $this->object   = $object;
    24         $this->term     = $term;
    25         $this->authors  = $authors;
     20        $this->compat       = $compat;
     21        $this->slug         = $slug;
     22        $this->taxonomy     = $taxonomy;
     23        $this->object       = $object;
     24        $this->term         = $term;
     25        $this->authors      = $authors;
     26        $this->contributors = $contributors;
    2627
    2728        // Remove global stickies from sticky array.
     
    215216                $retval = true;
    216217            }
     218
     219            // Compat contributors.
     220            if ( $this->contributors && in_array( $user->user_login, $this->contributors ) ) {
     221                $retval = true;
     222            }
    217223        }
    218224        return $retval;
Note: See TracChangeset for help on using the changeset viewer.