Skip to:
Content

bbPress.org

Changeset 2979


Ignore:
Timestamp:
04/03/2011 05:54:41 AM (15 years ago)
Author:
johnjamesjacoby
Message:

Fix incorrect variable returned in bbp_has_topics() filter, and improve inline documentation.

File:
1 edited

Legend:

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

    r2976 r2979  
    122122        $bbp->topic_query->max_num_pages = $max_num_pages;
    123123
    124     // Put sticky posts at the top of the posts array, much of this code
    125     // is taken from query.php in wp-includes
     124    // Put sticky posts at the top of the posts array
    126125    if ( !empty( $show_stickies ) && $paged <= 1 ) {
     126
     127        // Get super stickies and stickies in this forum
    127128        $stickies = bbp_get_super_stickies();
    128129        $stickies = !empty( $bbp_t['post_parent'] ) ? array_merge( $stickies, bbp_get_stickies( $post_parent ) ) : $stickies;
    129130        $stickies = array_unique( $stickies );
    130131
     132        // We have stickies
    131133        if ( is_array( $stickies ) && !empty( $stickies ) ) {
    132134
     135            // Setup the number of stickies and reset offset to 0
    133136            $num_topics    = count( $bbp->topic_query->posts );
    134137            $sticky_offset = 0;
     
    206209        // If pretty permalinks are enabled, make our pagination pretty
    207210        if ( $wp_rewrite->using_permalinks() ) {
     211
     212            // Profile page
    208213            if ( bbp_is_user_profile_page() )
    209214                $base = user_trailingslashit( trailingslashit( bbp_get_user_profile_url( bbp_get_displayed_user_id() ) ) . 'page/%#%/' );
     215
     216            // View
    210217            elseif ( bbp_is_view() )
    211218                $base = user_trailingslashit( trailingslashit( bbp_get_view_url() ) . 'page/%#%/' );
     219
     220            // Default
    212221            else
    213222                $base = user_trailingslashit( trailingslashit( get_permalink( $post_parent ) ) . 'page/%#%/' );
     223
     224        // Unpretty pagination
    214225        } else {
    215226            $base = add_query_arg( 'paged', '%#%' );
     
    235246
    236247    // Return object
    237     return apply_filters( 'bbp_has_topics', $bbp->topic_query->have_posts(), $bbp );
     248    return apply_filters( 'bbp_has_topics', $bbp->topic_query->have_posts(), $bbp->topic_query );
    238249}
    239250
Note: See TracChangeset for help on using the changeset viewer.