id summary reporter owner description type status priority milestone component version severity resolution keywords cc 6649 Compatibility with `WP_Hook` boonebgorges boonebgorges "See https://core.trac.wordpress.org/ticket/17817 and especially https://core.trac.wordpress.org/ticket/17817#comment:158. `bp_get_template_stack()` reaches into `$wp_filter` and operates on some nested arrays in situ. #WP17817 proposes that `$wp_filter` become an array of `WP_Hook` objects instead of multidimensional arrays. So things like `foreach ( current( $wp_filter[ $tag ] ) )` become impossible, because `$wp_filter[ $tag ]` is a `WP_Hook` object. `WP_Hook` does implement `ArrayAccess`, so passing it to `current()` doesn't throw a fatal error. But `WP_Hook` stores callbacks in the `callbacks` property, which is a different structure than what `bp_get_template_stack()` expects. jbrinley's recommendation is to assign the callback array (by reference) to a variable before operating on it, and to check `if ( class_exists( 'WP_Hook' ) )` in order to figure out how to set that variable. I've confirmed that this works. It's also completely backward compatible. The only change is the use of a variable where previously we were operating directly on `$wp_filter['bp_template_stack']`. The sooner we get this fix into BP, the sooner people will start upgrading to versions of BP that are `WP_Hook`-compatible. So I'm recommending that we go with the attached patch for 2.4." defect (bug) closed normal 2.4 Core normal fixed has-patch dev-feedback needs-testing