[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
Fri Dec 19 22:43:35 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 imath):
Gave it a look today, there's a lot of loops, and some can use very
specific logic.
For instance :
- getting the groups is using 3 different functions in case of invite /
single groups / or groups
- most of the queries are building an array lookings like this {{{array(
'items' => $items, 'total' => $total ) }}}, most of the time the first
argument is a plural form relating to the component eg: activities,
groups, blogs, notifications, but members is not used in favor of users
- while most of the loops are offering a consistent action when loop start
and ends, notifications is specific eg: {{{do_action( 'group_loop_start'
)}}}, {{{do_action( 'member_loop_start' )}}}, {{{do_action(
'activity_loop_start' )}}} > not plural forms, but {{{do_action(
'notifications_loop_start' )}}} > plural form
I think we should progressively add core loops but offer plugin devs an
abstract class they can use in their plugins. Then we will be able to
iterate and improve it thanks to plugin devs feedbacks.
1269.01.patch is a first example with the blogs component.
I've first built unit tests before editing the {{{BP_Blogs_Template}}}
class
then tested it extending the {{{BP_Template_Loop}}} class
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/1269#comment:11>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list