Making WordPress.org

Changeset 4041


Ignore:
Timestamp:
09/12/2016 09:37:51 PM (8 years ago)
Author:
jmdodd
Message:

Support Forums: Add imported sticky topics to plugin/theme compat view.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums
Files:
2 edited

Legend:

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

    r4026 r4041  
    2121    var $contributors = null;
    2222    var $query        = null;
     23    var $term         = null;
    2324
    2425    public function init() {
     
    130131            $this->register_views();
    131132
     133            // Set the term for this view so we can reuse it.
     134            $this->term = get_term_by( 'slug', $this->slug(), $this->taxonomy() );
     135
    132136            // Add theme-specific filters and actions.
    133137            add_action( 'wporg_compat_view_sidebar', array( $this, 'do_view_sidebar' ) );
     
    147151            if ( class_exists( 'WPORG_Ratings' ) && class_exists( 'WordPressdotorg\Forums\Ratings_Compat' ) ) {
    148152                $this->ratings = new Ratings_Compat( $this->compat(), $this->slug(), $this->taxonomy(), $this->get_object( $this->slug() ) );
     153            }
     154
     155            // Instantiate WPORG_Stickies mode for support view.
     156            if ( class_exists( 'WordPressdotorg\Forums\Stickies_Compat' ) ) {
     157                $this->stickies = new Stickies_Compat( $this->compat(), $this->slug(), $this->taxonomy(), $this->get_object( $this->slug() ), $this->term );
    149158            }
    150159
     
    164173                $this->authors           = $this->get_authors( $slug );
    165174                $this->contributors      = $this->get_contributors( $slug );
     175                $this->term              = $terms[0];
    166176
    167177                // Add output filters and actions.
     
    278288                    'terms'     => $this->slug(),
    279289                ) ),
    280                 'show_stickies' => false,
     290                'show_stickies' => true,
    281291                'meta_key'      => null,
    282292                'meta_compare'  => null,
     
    466476
    467477        $term_subscription = '';
    468         $term = get_term_by( 'slug', $this->slug(), $this->taxonomy() );
     478        $term = $this->term;
    469479        if ( ! $term ) {
    470480            // New compats won't have any support topics or reviews, so will
     
    474484        }
    475485        if ( $term ) {
     486            $this->term = $term;
    476487            $subscribe = $unsubscribe = '';
    477488            if ( 'plugin' == $this->compat() ) {
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/support-forums.php

    r3987 r4041  
    2727include( dirname( __FILE__ ) . '/inc/class-plugin-directory-compat.php' );
    2828include( dirname( __FILE__ ) . '/inc/class-ratings-compat.php' );
     29include( dirname( __FILE__ ) . '/inc/class-stickies-compat.php' );
    2930include( dirname( __FILE__ ) . '/inc/class-performance-optimizations.php' );
    3031
Note: See TracChangeset for help on using the changeset viewer.