diff --git a/bbp-includes/bbp-reply-template.php b/bbp-includes/bbp-reply-template.php
index 9fc3839..4509388 100644
|
a
|
b
|
function bbp_has_replies( $args = '' ) { |
| 140 | 140 | |
| 141 | 141 | // If pretty permalinks are enabled, make our pagination pretty |
| 142 | 142 | if ( $wp_rewrite->using_permalinks() ) { |
| 143 | | |
| | 143 | |
| 144 | 144 | // Page or single |
| 145 | 145 | if ( is_page() || is_single() ) { |
| 146 | | $base = user_trailingslashit( trailingslashit( get_permalink() ) . 'page/%#%/' ); |
| | 146 | $base = get_permalink(); |
| 147 | 147 | |
| 148 | 148 | // Topic |
| 149 | 149 | } else { |
| 150 | | $base = user_trailingslashit( trailingslashit( get_permalink( bbp_get_topic_id() ) ) . 'page/%#%/' ); |
| | 150 | $base = get_permalink( bbp_get_topic_id() ); |
| 151 | 151 | } |
| 152 | 152 | |
| | 153 | $base = trailingslashit( $base ) . user_trailingslashit( $wp_rewrite->pagination_base . '/%#%/' ); |
| | 154 | |
| 153 | 155 | // Unpretty permalinks |
| 154 | 156 | } else { |
| 155 | 157 | $base = add_query_arg( 'paged', '%#%' ); |
| … |
… |
function bbp_has_replies( $args = '' ) { |
| 172 | 174 | |
| 173 | 175 | // Remove first page from pagination |
| 174 | 176 | 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 ); |
| 176 | 178 | 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 ); |
| 178 | 180 | } |
| 179 | 181 | |
| 180 | 182 | // Return object |
| … |
… |
function bbp_reply_excerpt( $reply_id = 0, $length = 100 ) { |
| 527 | 529 | * @return string Content with the revisions appended |
| 528 | 530 | */ |
| 529 | 531 | function bbp_reply_content_append_revisions( $content = '', $reply_id = 0 ) { |
| 530 | | |
| | 532 | |
| 531 | 533 | // Bail if in admin |
| 532 | 534 | if ( is_admin() ) |
| 533 | 535 | return; |
diff --git a/bbp-includes/bbp-topic-template.php b/bbp-includes/bbp-topic-template.php
index 167ccd8..933e5a5 100644
|
a
|
b
|
function bbp_has_topics( $args = '' ) { |
| 238 | 238 | |
| 239 | 239 | // Profile page |
| 240 | 240 | if ( bbp_is_single_user() ) |
| 241 | | $base = user_trailingslashit( trailingslashit( bbp_get_user_profile_url( bbp_get_displayed_user_id() ) ) . 'page/%#%/' ); |
| | 241 | $base = bbp_get_user_profile_url( bbp_get_displayed_user_id() ); |
| 242 | 242 | |
| 243 | 243 | // View |
| 244 | 244 | elseif ( bbp_is_single_view() ) |
| 245 | | $base = user_trailingslashit( trailingslashit( bbp_get_view_url() ) . 'page/%#%/' ); |
| | 245 | $base = bbp_get_view_url(); |
| 246 | 246 | |
| 247 | 247 | // Page or single post |
| 248 | 248 | elseif ( is_page() || is_single() ) |
| 249 | | $base = user_trailingslashit( trailingslashit( get_permalink() ) . 'page/%#%/' ); |
| | 249 | $base = get_permalink(); |
| 250 | 250 | |
| 251 | 251 | // Topic archive |
| 252 | 252 | elseif ( bbp_is_topic_archive() ) |
| 253 | | $base = user_trailingslashit( trailingslashit( home_url( $bbp->topic_archive_slug ) ) . 'page/%#%/' ); |
| | 253 | $base = home_url( $bbp->topic_archive_slug ); |
| 254 | 254 | |
| 255 | 255 | // Default |
| 256 | 256 | else |
| 257 | | $base = user_trailingslashit( trailingslashit( get_permalink( $post_parent ) ) . 'page/%#%/' ); |
| | 257 | $base = get_permalink( $post_parent ); |
| 258 | 258 | |
| | 259 | $base = trailingslashit( $base ) . user_trailingslashit( $wp_rewrite->pagination_base . '/%#%/' ); |
| 259 | 260 | // Unpretty pagination |
| 260 | 261 | } else { |
| 261 | 262 | $base = add_query_arg( 'paged', '%#%' ); |
| … |
… |
function bbp_has_topics( $args = '' ) { |
| 276 | 277 | $bbp->topic_query->pagination_links = paginate_links ( $bbp_topic_pagination ); |
| 277 | 278 | |
| 278 | 279 | // Remove first page from pagination |
| 279 | | $bbp->topic_query->pagination_links = str_replace( 'page/1/\'', '\'', $bbp->topic_query->pagination_links ); |
| | 280 | $bbp->topic_query->pagination_links = str_replace( $wp_rewrite->pagination_base . "/1/'", "'", $bbp->topic_query->pagination_links ); |
| 280 | 281 | } |
| 281 | 282 | |
| 282 | 283 | // Return object |
| … |
… |
function bbp_topic_pagination( $args = '' ) { |
| 655 | 656 | |
| 656 | 657 | // If pretty permalinks are enabled, make our pagination pretty |
| 657 | 658 | if ( $wp_rewrite->using_permalinks() ) |
| 658 | | $base = user_trailingslashit( trailingslashit( get_permalink( $topic_id ) ) . 'page/%#%/' ); |
| | 659 | $base = trailingslashit( get_permalink( $topic_id ) ) . user_trailingslashit( $wp_rewrite->pagination_base . '/%#%/' ); |
| 659 | 660 | else |
| 660 | 661 | $base = add_query_arg( 'paged', '%#%' ); |
| 661 | 662 | |
| … |
… |
function bbp_topic_pagination( $args = '' ) { |
| 683 | 684 | |
| 684 | 685 | // Remove first page from pagination |
| 685 | 686 | if ( $wp_rewrite->using_permalinks() ) |
| 686 | | $pagination_links = str_replace( 'page/1/', '', $pagination_links ); |
| | 687 | $pagination_links = str_replace( $wp_rewrite->pagination_base . '1/', '', $pagination_links ); |
| 687 | 688 | else |
| 688 | 689 | $pagination_links = str_replace( '&paged=1', '', $pagination_links ); |
| 689 | 690 | |
diff --git a/bbpress.php b/bbpress.php
index 40653d5..c48d3a5 100644
|
a
|
b
|
class bbPress { |
| 931 | 931 | $this->topic_tag_slug . '/([^/]+)/edit/?$' => 'index.php?' . $this->topic_tag_tax_id . '=' . $wp_rewrite->preg_index( 1 ) . '&edit=1', |
| 932 | 932 | |
| 933 | 933 | // Profile Page |
| 934 | | $this->user_slug . '/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?' . $this->user_id . '=' . $wp_rewrite->preg_index( 1 ) . '&paged=' . $wp_rewrite->preg_index( 2 ), |
| | 934 | $this->user_slug . '/([^/]+)/' . $wp_rewrite->pagination_base . '/?([0-9]{1,})/?$' => 'index.php?' . $this->user_id . '=' . $wp_rewrite->preg_index( 1 ) . '&paged=' . $wp_rewrite->preg_index( 2 ), |
| 935 | 935 | $this->user_slug . '/([^/]+)/?$' => 'index.php?' . $this->user_id . '=' . $wp_rewrite->preg_index( 1 ), |
| 936 | 936 | $this->user_slug . '/([^/]+)/edit/?$' => 'index.php?' . $this->user_id . '=' . $wp_rewrite->preg_index( 1 ) . '&edit=1', |
| 937 | 937 | |
| … |
… |
class bbPress { |
| 943 | 943 | //$this->view_slug . '/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?' . $this->view_id . '=' . $wp_rewrite->preg_index( 1 ) . '&feed=' . $wp_rewrite->preg_index( 2 ), |
| 944 | 944 | |
| 945 | 945 | // View Page |
| 946 | | $this->view_slug . '/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?' . $this->view_id . '=' . $wp_rewrite->preg_index( 1 ) . '&paged=' . $wp_rewrite->preg_index( 2 ), |
| | 946 | $this->view_slug . '/([^/]+)/' . $wp_rewrite->pagination_base . '/?([0-9]{1,})/?$' => 'index.php?' . $this->view_id . '=' . $wp_rewrite->preg_index( 1 ) . '&paged=' . $wp_rewrite->preg_index( 2 ), |
| 947 | 947 | $this->view_slug . '/([^/]+)/?$' => 'index.php?' . $this->view_id . '=' . $wp_rewrite->preg_index( 1 ) |
| 948 | 948 | ); |
| 949 | 949 | |