Skip to:
Content

bbPress.org

Opened 3 years ago

Closed 2 years ago

#2996 closed defect (fixed)

is_bbpress() does not work on pages that use bbpress shortcodes

Reported by: Themezly Owned by: johnjamesjacoby
Milestone: 2.6 Priority: high
Severity: normal Version: 2.0
Component: API - Shortcodes Keywords: commit
Cc:

Description

Create new page , add

[bbp-forum-index]

Try to check is_bbpress() on that page and it will return false.

This conditional is used to enque/deque specific styles or remove bbpress styles from other pages and users endup with styleless pages if bbpress shortcodes are used.

Change History (2)

#1 @johnjamesjacoby
2 years ago

  • Component changed from General to API - Shortcodes
  • Keywords commit added
  • Milestone changed from Awaiting Review to 2.6
  • Owner set to johnjamesjacoby
  • Version set to 2.0

Moving to 2.6 to introduce bbp_has_shortcode().

#2 @johnjamesjacoby
2 years ago

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

In 6440:

Common: introduce bbp_has_shortcode() to check if some text contains a bbPress shortcode.

If a shortcode was found in the global post content, a few extra things will happen:

  • The bbp-shortcode class is added to the body tag
  • is_bbpress() will now return true, to help enqueue additional styles & scripts on those pages in themes that want to support bbPress natively

Fixes #2996.

Note: See TracTickets for help on using tickets.