Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/04/2017 03:54:06 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Queries: Use new object_type over old post_type.

When bbp_get_user_object_ids() was introduced, some helpers did not get updated to use the new argument key. This change fixes that, and fixes failing tests in the process.

Note that these tests are testing new & unused helper functions for 2.6, so it's unlikely any noticable problems occurred from these being broken.

File:
1 edited

Legend:

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

    r6611 r6612  
    648648    $user_id = bbp_get_user_id( $user_id );
    649649    $bbp_db  = bbp_db();
     650    $statii  = "'" . implode( "', '", bbp_get_public_topic_statuses() ) . "'";
    650651    $sql     = "SELECT COUNT(*)
    651652            FROM {$bbp_db->posts}
    652653            WHERE post_author = %d
    653654                AND post_type = %s
    654                 AND post_status = %s";
    655 
    656     $query   = $bbp_db->prepare( $sql, $user_id, bbp_get_reply_post_type(), bbp_get_public_status_id() );
     655                AND post_status IN ({$statii})";
     656
     657    $query   = $bbp_db->prepare( $sql, $user_id, bbp_get_reply_post_type() );
    657658    $count   = (int) $bbp_db->get_var( $query );
    658659
Note: See TracChangeset for help on using the changeset viewer.