Opened 10 years ago
Closed 10 years ago
#6369 closed regression (fixed)
_bp_strip_spans_from_title() causing fatal errors in 2.2.2
Reported by: | DJPaul | Owned by: | djpaul |
---|---|---|---|
Milestone: | 2.2.2.1 | Priority: | omg pizza |
Severity: | blocker | Version: | 2.2.2 |
Component: | Core | Keywords: | |
Cc: |
Description
r9732 (#6107) introduced this fatal error:
Fatal error: Cannot redeclare _bp_strip_spans_from_title() (previously declared in /wp-content/plugins/buddypress/bp-core/bp-core-filters.php:552) in /wp-content/plugins/buddypress/bp-core/bp-core-filters.php on line 552
This is because _bp_strip_spans_from_title
is nested inside bp_modify_page_title
. If a site calls any of WP's title functions more than once (for example, wp_title
or get_the_title
), it triggers the fatal error. You can reproduce this easily by adding <?php wp_title(); ?>
into the bottom of the active theme's footer.php
, for example.
Thanks to @danbp for raising awareness in Slack, via @imath. First reported on the forums:
- https://buddypress.org/support/topic/fatal-error-after-update/
- https://buddypress.org/support/topic/groups-function-not-working/
Relevant Slack logs of the investigation/discussion are at https://wordpress.slack.com/archives/buddypress/p1428739967001905
From limited investigation of one of the reported sites that have this problem, I was unable to find a plugin that was triggering this problem, but imath and I are pretty sure that we have identified the root cause, even if we can't point to some theme/plugin/widget that demonstrates the problem.