Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/14/2011 01:33:23 AM (10 years ago)
Author:
johnjamesjacoby
Message:

Fix pagination issues when using topics shortcode on front page. Also use pagination_base instead of 'page'.

Fixes #1567, #1573. Props scribu.

File:
1 edited

Legend:

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

    r3352 r3361  
    141141        // If pretty permalinks are enabled, make our pagination pretty
    142142        if ( $wp_rewrite->using_permalinks() ) {
    143                
     143
    144144            // Page or single
    145145            if ( is_page() || is_single() ) {
    146                 $base = user_trailingslashit( trailingslashit( get_permalink() ) . 'page/%#%/' );
     146                $base = get_permalink();
    147147
    148148            // Topic
    149149            } else {
    150                 $base = user_trailingslashit( trailingslashit( get_permalink( bbp_get_topic_id() ) ) . 'page/%#%/' );
     150                $base = get_permalink( bbp_get_topic_id() );
    151151            }
     152
     153            $base = trailingslashit( $base ) . user_trailingslashit( $wp_rewrite->pagination_base . '/%#%/' );
    152154
    153155        // Unpretty permalinks
     
    173175        // Remove first page from pagination
    174176        if ( $wp_rewrite->using_permalinks() )
    175             $bbp->reply_query->pagination_links = str_replace( 'page/1/\'',     '\'', $bbp->reply_query->pagination_links );
     177            $bbp->reply_query->pagination_links = str_replace( $wp_rewrite->pagination_base . '/1/', '', $bbp->reply_query->pagination_links );
    176178        else
    177             $bbp->reply_query->pagination_links = str_replace( '&paged=1', '',   $bbp->reply_query->pagination_links );
     179            $bbp->reply_query->pagination_links = str_replace( '&paged=1', '', $bbp->reply_query->pagination_links );
    178180    }
    179181
     
    388390            // Pretty permalinks
    389391            if ( $wp_rewrite->using_permalinks() ) {
    390                 $url = trailingslashit( $topic_url ) . trailingslashit( "page/{$reply_page}" ) . $reply_hash;
     392                $url = trailingslashit( $topic_url ) . trailingslashit( $wp_rewrite->pagination_base ) . trailingslashit( $reply_page ) . $reply_hash;
    391393
    392394            // Yucky links
     
    528530 */
    529531function bbp_reply_content_append_revisions( $content = '', $reply_id = 0 ) {
    530    
     532
    531533    // Bail if in admin
    532534    if ( is_admin() )
Note: See TracChangeset for help on using the changeset viewer.