Changeset 2979
- Timestamp:
- 04/03/2011 05:54:41 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-topic-template.php
r2976 r2979 122 122 $bbp->topic_query->max_num_pages = $max_num_pages; 123 123 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 126 125 if ( !empty( $show_stickies ) && $paged <= 1 ) { 126 127 // Get super stickies and stickies in this forum 127 128 $stickies = bbp_get_super_stickies(); 128 129 $stickies = !empty( $bbp_t['post_parent'] ) ? array_merge( $stickies, bbp_get_stickies( $post_parent ) ) : $stickies; 129 130 $stickies = array_unique( $stickies ); 130 131 132 // We have stickies 131 133 if ( is_array( $stickies ) && !empty( $stickies ) ) { 132 134 135 // Setup the number of stickies and reset offset to 0 133 136 $num_topics = count( $bbp->topic_query->posts ); 134 137 $sticky_offset = 0; … … 206 209 // If pretty permalinks are enabled, make our pagination pretty 207 210 if ( $wp_rewrite->using_permalinks() ) { 211 212 // Profile page 208 213 if ( bbp_is_user_profile_page() ) 209 214 $base = user_trailingslashit( trailingslashit( bbp_get_user_profile_url( bbp_get_displayed_user_id() ) ) . 'page/%#%/' ); 215 216 // View 210 217 elseif ( bbp_is_view() ) 211 218 $base = user_trailingslashit( trailingslashit( bbp_get_view_url() ) . 'page/%#%/' ); 219 220 // Default 212 221 else 213 222 $base = user_trailingslashit( trailingslashit( get_permalink( $post_parent ) ) . 'page/%#%/' ); 223 224 // Unpretty pagination 214 225 } else { 215 226 $base = add_query_arg( 'paged', '%#%' ); … … 235 246 236 247 // 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 ); 238 249 } 239 250
Note: See TracChangeset
for help on using the changeset viewer.