Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/27/2017 03:47:49 AM (7 years ago)
Author:
johnjamesjacoby
Message:

General: Tidying from looking into #2876.

File:
1 edited

Legend:

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

    r6434 r6437  
    16891689        $post_status = "'" . implode( "', '", $post_status ) . "'";
    16901690        $bbp_db      = bbp_db();
     1691
     1692        // Note that we can't use WP_Query here thanks to post_status assumptions
    16911693        $query       = $bbp_db->prepare( "SELECT ID FROM {$bbp_db->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = %s ORDER BY ID DESC", $parent_id, $post_type );
    16921694        $child_ids   = (array) $bbp_db->get_col( $query );
    16931695
     1696        // Always cache the results
    16941697        wp_cache_set( $cache_id, $child_ids, 'bbpress_posts' );
    1695     } else {
    1696         $child_ids = (array) $child_ids;
    1697     }
     1698    }
     1699
     1700    // Make sure results are INTs
     1701    $child_ids = wp_parse_id_list( $child_ids );
    16981702
    16991703    // Filter and return
Note: See TracChangeset for help on using the changeset viewer.