Skip to:
Content

bbPress.org

Ticket #2702: 2702.2.diff

File 2702.2.diff, 1.5 KB (added by netweb, 10 years ago)
  • 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        }
  • src/includes/topics/template.php

     
    914914                        if ( $wp_rewrite->using_permalinks() ) {
    915915                                $pagination_links = str_replace( $wp_rewrite->pagination_base . '/1/', '', $pagination_links );
    916916                        } else {
    917                                 $pagination_links = str_replace( '&paged=1', '', $pagination_links );
     917                                $pagination_links = preg_replace_callback( '/&paged=1[^0-9]/',
     918                                        function( $matches ){
     919                                                return str_replace( '&paged=1', '', $matches[0] );
     920                                        },
     921                                        $pagination_links );
    918922                        }
    919923
    920924                        // Add before and after to pagination links