Skip to:
Content

bbPress.org

Changeset 6437


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

General: Tidying from looking into #2876.

Location:
trunk/src/includes
Files:
2 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
  • trunk/src/includes/replies/template.php

    r6433 r6437  
    18291829        // Reply doesn't have a position so get the raw value
    18301830        if ( empty( $reply_position ) ) {
    1831             $topic_id = ! empty( $topic_id ) ? bbp_get_topic_id( $topic_id ) : bbp_get_reply_topic_id( $reply_id );
     1831
     1832            // Get topic ID
     1833            $topic_id = ! empty( $topic_id )
     1834                ? bbp_get_topic_id( $topic_id )
     1835                : bbp_get_reply_topic_id( $reply_id );
    18321836
    18331837            // Post is not the topic
Note: See TracChangeset for help on using the changeset viewer.