[buddypress-trac] [BuddyPress] #5138: Audit & replace $bp global touches with wrapper functions & methods
buddypress-trac
noreply at wordpress.org
Mon Aug 12 21:37:28 UTC 2013
#5138: Audit & replace $bp global touches with wrapper functions & methods
-----------------------------+------------------------------
Reporter: johnjamesjacoby | Owner: johnjamesjacoby
Type: task | Status: new
Priority: normal | Milestone: 1.9
Component: Rewrite Rules | Version: 1.0
Severity: normal | Resolution:
Keywords: needs-patch |
-----------------------------+------------------------------
Description changed by johnjamesjacoby:
Old description:
> BuddyPress touches the `$bp` global directly countless times. In the
> past, this was fine enough, as it gave us an easy and reliable way to get
> global data relative to BuddyPress's current state. As BuddyPress becomes
> more robust, this is becoming more fragile, more difficult to extend, and
> a bottleneck for future enhancements to the software.
>
> One specific case is adding rewrite rules, a feature slated for 1.8,
> bumped to 1.9.
>
> Because we directly reference `$bp->current_user->domain` inside
> templates, functions, methods, and classes, translating that reference
> into an unpretty permalink becomes problematic, as existing plugins have
> come to expect that it is always a pretty URL.
>
> Another case is the `$bp->pages` array. As we introduce rewrite rules,
> our dependance on this array will disappear, though because we reference
> it directly in 60+ places, we're forced to touch these references rather
> than using a function and replacing its guts.
>
> There are numerous other examples that require ongoing clean-up, both
> related and unrelated to adding rewrite rules in 1.9 and beyond. I'm
> creating this ticket as a general task to patch and commit changes to
> `$bp` touches towards.
New description:
BuddyPress touches the `$bp` global directly countless times. In the past,
this was fine enough, as it gave us an easy and reliable way to get global
data relative to BuddyPress's current state. As BuddyPress becomes more
robust, this is becoming more fragile, more difficult to extend, and a
bottleneck for future enhancements to the software.
One specific case is adding rewrite rules, a feature slated for 1.8,
bumped to 1.9.
Because we directly reference `$bp->loggedin_user->domain` inside
templates, functions, methods, and classes, translating that reference
into an unpretty permalink becomes problematic, as existing plugins have
come to expect that it is always a pretty URL.
Another case is the `$bp->pages` array. As we introduce rewrite rules, our
dependance on this array will disappear, though because we reference it
directly in 60+ places, we're forced to touch these references rather than
using a function and replacing its guts.
There are numerous other examples that require ongoing clean-up, both
related and unrelated to adding rewrite rules in 1.9 and beyond. I'm
creating this ticket as a general task to patch and commit changes to
`$bp` touches towards.
--
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5138#comment:1>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list