Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/16/2015 04:15:12 AM (6 years ago)
Author:
johnjamesjacoby
Message:

Queries: Clean up post status concatenation in 2 queries.

This changeset moves array of "hidden" type post-statuses into their own variable to better match existing usages.

Fixes #2826.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/forums/functions.php

    r5856 r5858  
    15861586        // Get topics of forum
    15871587        if ( empty( $topic_count ) ) {
     1588            $statuses    = array( bbp_get_trash_status_id(), bbp_get_spam_status_id(), bbp_get_pending_status_id() );
     1589            $post_status = "'" . implode( "','", $statuses ) . "'";
    15881590            $bbp_db      = bbp_db();
    1589             $post_status = "'" . implode( "','", array( bbp_get_trash_status_id(), bbp_get_spam_status_id(), bbp_get_pending_status_id() ) ) . "'";
    15901591            $topic_count = $bbp_db->get_var( $bbp_db->prepare( "SELECT COUNT(ID) FROM {$bbp_db->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s';", $forum_id, bbp_get_topic_post_type() ) );
    15911592        }
Note: See TracChangeset for help on using the changeset viewer.