Skip to:

Opened 10 years ago

Closed 10 years ago

#5751 closed defect (bug) (fixed)

bp_is_current_component() fallback $page check breaks on certain custom components

Reported by: boonebgorges's profile boonebgorges Owned by: boonebgorges's profile boonebgorges
Milestone: 2.1 Priority: low
Severity: normal Version:
Component: Core Keywords:


When combining custom post type archives with custom BuddyPress components, the page template fallback checks in bp_is_current_component() can fail improperly. There, we get the current "page" with get_queried_object(). But in the case of an archive, the return value will not have an ID. Thus, we should check for the existence of the ID property before looking for a corresponding page template.

Change History (1)

#1 @boonebgorges
10 years ago

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

In 8611:

More conservative page_template checks in bp_is_current_component()

The page_template checks in bp_is_current_component() should not go through if
the currently queried object is not a single page (ie when a plugin is forcing
it to be a CPT archive). So we check for the presence of the ID property
before attempting to use it.

Fixes #5751

Note: See TracTickets for help on using tickets.