Skip to:
Content

bbPress.org


Ignore:
Timestamp:
02/18/2011 10:16:22 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Decouple bbp_is_ functionality from bbp_get_{post_type}_id functionality, and use correctly through-out. Add ability to show all forums regardless of post_parent, and fix forums widget to use this functionality correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-topic-functions.php

    r2907 r2914  
    13581358
    13591359    // If it's a reply, then get the parent (topic id)
    1360     if ( $reply_id = bbp_get_reply_id( $topic_id ) )
    1361         $topic_id = bbp_get_reply_topic_id( $reply_id );
     1360    if ( bbp_is_reply( $topic_id ) )
     1361        $topic_id = bbp_get_reply_topic_id( $topic_id );
    13621362    else
    13631363        $topic_id = bbp_get_topic_id( $topic_id );
     
    13911391
    13921392    // If it's a reply, then get the parent (topic id)
    1393     if ( $reply_id = bbp_get_reply_id( $topic_id ) )
     1393    if ( bbp_is_reply( $topic_id ) )
    13941394        $topic_id = bbp_get_reply_topic_id( $reply_id );
    13951395    else
     
    14261426
    14271427    // If it's a reply, then get the parent (topic id)
    1428     if ( $reply_id = bbp_get_reply_id( $topic_id ) )
    1429         $topic_id = bbp_get_reply_topic_id( $reply_id );
     1428    if ( bbp_is_reply( $topic_id ) )
     1429        $topic_id = bbp_get_reply_topic_id( $topic_id );
    14301430    else
    14311431        $topic_id = bbp_get_topic_id( $topic_id );
     
    14551455
    14561456    // If it's a reply, then get the parent (topic id)
    1457     if ( $reply_id = bbp_get_reply_id( $topic_id ) )
    1458         $topic_id = bbp_get_reply_topic_id( $reply_id );
     1457    if ( bbp_is_reply( $topic_id ) )
     1458        $topic_id = bbp_get_reply_topic_id( $topic_id );
    14591459    else
    14601460        $topic_id = bbp_get_topic_id( $topic_id );
     
    14881488
    14891489    // If it's a reply, then get the parent (topic id)
    1490     if ( $reply_id = bbp_get_reply_id( $topic_id ) )
     1490    if ( bbp_is_reply( $topic_id ) )
    14911491        $topic_id = bbp_get_reply_topic_id( $reply_id );
    14921492    else
     
    15171517
    15181518    // If it's a reply, then get the parent (topic id)
    1519     if ( empty( $reply_id ) && $reply_id = bbp_get_reply_id( $topic_id ) ) {
     1519    if ( empty( $reply_id ) && bbp_is_reply( $topic_id ) ) {
     1520        $reply_id = bbp_get_reply_id( $topic_id );
    15201521        $topic_id = bbp_get_reply_topic_id( $reply_id );
    15211522    } else {
     
    15561557
    15571558    // If it's a reply, then get the parent (topic id)
    1558     if ( $reply_id = bbp_get_reply_id( $topic_id ) )
    1559         $topic_id = bbp_get_reply_topic_id( $reply_id );
     1559    if ( bbp_is_reply( $topic_id ) )
     1560        $topic_id = bbp_get_reply_topic_id( $topic_id );
    15601561    else
    15611562        $topic_id = bbp_get_topic_id( $topic_id );
Note: See TracChangeset for help on using the changeset viewer.