Skip to:
Content

bbPress.org

#3358 closed defect (fixed)

[bbp-single-tag id=X] shortcode pagination is not working

Reported by: wpturk Owned by: johnjamesjacoby
Milestone: 2.6.7 Priority: high
Severity: normal Version: 2.1
Component: Appearance - Theme Compatibility Keywords:
Cc:

Description

This is happening because of these lines in function bbp_get_topics_pagination_base:

<?php
.....
            // Topic tag
                } elseif ( bbp_is_topic_tag() ) {
                         $base = bbp_get_topic_tag_link();

              // Page or single post
               } elseif ( is_page() || is_single() ) {
                        $base = get_permalink();
...

Actually, our shortcode is in a page, but the if statement "elseif ( bbp_is_topic_tag()" turns true and the base link for paginations returns empty.

A possible solution is to put "is_page" statment before "bbp_is_topic_tag" than everything works fine.

<?php
.....

             // Page or single post
               } elseif ( is_page() || is_single() ) {
                        $base = get_permalink();

            // Topic tag
                } elseif ( bbp_is_topic_tag() ) {
                         $base = bbp_get_topic_tag_link();
...

Attachments (1)

3358.patch (2.9 KB) - added by johnjamesjacoby 10 months ago.

Download all attachments as: .zip

Change History (4)

#1 @johnjamesjacoby
10 months ago

  • Component changed from General to Appearance - Theme Compatibility
  • Milestone changed from Awaiting Review to 2.6.7
  • Owner set to johnjamesjacoby
  • Status changed from new to accepted
  • Version changed from 2.6.4 to 2.1

#2 @johnjamesjacoby
10 months ago

In 7175:

Theme Compatibility: improve handling of shortcodes in some template functions.

This commit swaps out is_page() || is_single() for is_singular() which is easier to understand, and also raises the priority of that conditional check inside bbp_get_topics_pagination_base(), allowing it to work as intended inside of topic views and tags shortcode usages.

In trunk for 2.7.0. See #3358.

#3 @johnjamesjacoby
10 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 7176:

Theme Compatibility: improve handling of shortcodes in some template functions.

This commit swaps out is_page() || is_single() for is_singular() which is easier to understand, and also raises the priority of that conditional check inside bbp_get_topics_pagination_base(), allowing it to work as intended inside of topic views and tags shortcode usages.

In branches/2.6 for 2.6.7. Fixes #3358.

Note: See TracTickets for help on using tickets.