Skip to:
Content

bbPress.org

Ticket #2702: 2702.diff

File 2702.diff, 855 bytes (added by tharsheblows, 10 years ago)

don't replace paged=1 in eg paged=14

  • src/includes/replies/template.php

     
    273273                        // Remove first page from pagination
    274274                        if ( $wp_rewrite->using_permalinks() ) {
    275275                                $bbp->reply_query->pagination_links = str_replace( $wp_rewrite->pagination_base . '/1/', '', $bbp->reply_query->pagination_links );
    276                         } else {
    277                                 $bbp->reply_query->pagination_links = str_replace( '&paged=1', '', $bbp->reply_query->pagination_links );
     276                        } else{
     277                                $bbp->reply_query->pagination_links = preg_replace_callback( '/&paged=1[^0-9]/',
     278                                        function( $matches ){
     279                                                 return str_replace( '&paged=1', '', $matches[0] );       
     280                                        },
     281                                        $bbp->reply_query->pagination_links );
    278282                        }
    279283                }
    280284        }