[buddypress-trac] [BuddyPress Trac] #1269: Create a BP_Loop_Template base class that all template classes can inherit from

buddypress-trac noreply at wordpress.org
Sun Dec 21 18:44:24 UTC 2014


#1269: Create a BP_Loop_Template base class that all template classes can inherit
from
------------------------------------+------------------------------
 Reporter:  rvenable                |       Owner:  johnjamesjacoby
     Type:  enhancement             |      Status:  assigned
 Priority:  normal                  |   Milestone:  2.3
Component:  Theme / Template Parts  |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:                          |
------------------------------------+------------------------------

Comment (by boonebgorges):

 imath - Thanks for your research and work on this!

 It's a bit annoying (although not surprising) that BP's loops are
 inconsistent in the ways you've described. But, as you note, we shouldn't
 let that hold us up. Core subclasses like `BP_Groups_Template` can just
 override additional parent methods to maintain backward compatibility, and
 where necessary, we can break up some of the big methods so that the bits
 that get overridden are smaller.

 A couple principles going forward:

 - In cases where you're overriding a non-abstract class - that is, a
 specific component's template loop has to override a `BP_Template_Loop`
 method for backward compatibility or because it's got to do something
 special - let's make sure that the docblock explains the reasoning.
 - As noted above, if we find that we have to override something in
 `BP_Template_Loop`, let's try to make it as narrow as possible. If that
 means breaking up a big method so that it calls some smaller methods, then
 let's do it.
 - I think we'll need to maintain methods like `rewind_blogs()`, just in
 case anyone is calling them directly. We can turn them into wrappers for
 `rewind_items()` etc, and if you want, we can throw deprecated function
 notices (though I don't care one way or another about that).
 - Let's make sure that the docblocks for the `BP_Template_Loop` hooks are
 really good. These will be dynamic hooks, so we want to make sure that
 they're documented thoroughly.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/1269#comment:12>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list