Skip to:
Content

bbPress.org

Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#2343 closed enhancement (fixed)

Theme compat enhancements

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

Description

There is some discussion on http://buddypress.trac.wordpress.org/ticket/5021 regarding tightening up the theme compatibility scope to only happen at the beginning and end of the main query loop. While looking at this, there are several other enhancements and code improvements that should be done.

  • Remove code duplication
  • Use WP_Post instead of dummy array
  • Introduce helper functions to handle located root templates
  • Handle recursion of nested the_content() calls or nested 'the_content' filter usage

Change History (7)

#1 @johnjamesjacoby
9 years ago

In 4975:

Theme Compatibility improvements:

  • Introduce helper functions to set and check a located root template, to aid in turning off theme-compat.
  • Introduce bbp_do_theme_compat() which checks if we're in the main loop, and the $post global has been primed with theme-compat dummy data.
  • Use WP_Post in bbp_theme_compat_reset_post(), and clean up this function a bit.
  • Set theme_compat active to false after bbp_replace_the_content() has started, to avoid recursing through nested 'the_content' filter usages.
  • Refactor output buffering used in bbp_replace_the_content() to clean up shortcode usages.
  • See #2343.

#2 @johnjamesjacoby
9 years ago

In 4976:

Try theme compat without adding and removing all of the filters from the_content. Now that theme compatibility has matured, this may not be necessary anymore. See #2343.

#3 @alexvorn2
9 years ago

does the new patch resolve this issue: https://bbpress.trac.wordpress.org/ticket/1978 ???

#4 @johnjamesjacoby
9 years ago

In 4978:

Use the forum content in search results, and not the_excerpt() to avoid recursed calls to 'the_content'. See #2343.

#5 @johnjamesjacoby
8 years ago

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

So far, so good here. Closing as fixed.

#6 @johnjamesjacoby
8 years ago

In 5042:

Prevent nested shortcodes if used inside bbPress post_content. Reverts r4976. See #2343.

#7 @johnjamesjacoby
8 years ago

In 5043:

New approach to content replacement for theme compatability. Rather than juggle the post global and post content around in two procedures, set post_content via bbp_theme_compat_reset_post().

This reduces some complexity, avoids nested shortcodes, and fixes shortcode and the_content filter conflicts. See #2343.

Note: See TracTickets for help on using tickets.