[buddypress-trac] [BuddyPress Trac] #7253: On cleanup, theme compat sets `is_page` to true even if it wasn't to begin with
buddypress-trac
noreply at wordpress.org
Tue Sep 13 15:48:26 UTC 2016
#7253: On cleanup, theme compat sets `is_page` to true even if it wasn't to begin
with
--------------------------+-----------------------
Reporter: boonebgorges | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.7
Component: Core | Version: 1.9.2
Severity: normal | Keywords: has-patch
--------------------------+-----------------------
During the normal theme compat process, BuddyPress hijacks the content of
a WP page to display its own content. Within `the_content()`, BP needs
`is_page()` to be false, so it sets `$wp_query->is_page` to false. At the
end of the loop, it resets this value to `true`. This works fine during a
regular BP page load, because in this case, `is_page` will always be
`true` when the loop starts.
However, if you manage to use theme compat in a non-page context (it can
be done!!), things break a bit. Specifically, if a plugin uses theme
compat on, say, a post-type archive, then `bp_theme_compat_loop_end()`
will set `is_page` to true at the end of the loop, which results in errors
for code that runs after the loop is finished.
This should be fixable by only setting the `is_page_toggled` flag when, in
fact, `is_page` is actually toggled. I don't see any harm in this, but I'd
like a sanity check before continuing with it.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7253>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list