WordPress.org

Making WordPress.org

Changeset 3939


Ignore:
Timestamp:
09/03/16 04:13:18 (16 months ago)
Author:
jmdodd
Message:

Support Forums: Exclude reviews from bound id calculation.

Because reviews are being imported async, they are out of order with the rest of the forum.

Excludes plugins, themes, and reviews from non-specific views.

File:
1 edited

Legend:

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

    r3922 r3939  
    7676                $this->query = $r; 
    7777            } 
     78 
     79            if ( bbp_is_single_view() && ! in_array( bbp_get_view_id(), array( 'plugin', 'theme', 'reviews', 'active' ) ) ) { 
     80                $r['post_parent__not_in'] = array( Plugin::THEMES_FORUM_ID, Plugin::PLUGINS_FORUM_ID, Plugin::REVIEWS_FORUM_ID ); 
     81            } 
    7882        } 
    7983        return $r; 
     
    180184        if ( false === $bound_id ) { 
    181185 
    182             // Use the type_status_date index. 
     186            // Use the type_status_date index, excluding reviews because they were imported last. 
    183187            $bound_id = $wpdb->get_var( " 
    184188                SELECT `ID` 
     
    186190                WHERE post_type = 'topic' 
    187191                    AND post_status IN ( 'publish', 'closed' ) 
     192                    AND post_parent != 21272 
    188193                    AND post_date < DATE_SUB( NOW(), INTERVAL $interval ) 
    189194                ORDER BY `ID` DESC 
Note: See TracChangeset for help on using the changeset viewer.