[buddypress-trac] [BuddyPress Trac] #6844: Extract & relocate core markup functions: Theme compat include functionality & search forms file

buddypress-trac noreply at wordpress.org
Wed Jan 27 03:50:09 UTC 2016


#6844: Extract & relocate core markup functions:  Theme compat include
functionality & search forms file
-----------------------------------------+------------------------------
 Reporter:  hnla                         |       Owner:
     Type:  enhancement                  |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Appearance - Template Parts  |     Version:
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch dev-feedback       |
-----------------------------------------+------------------------------

Comment (by boonebgorges):

 Thanks for the initial patch, hnla.

 It seems to me that, in a quest to maintain backward compatibility, we've
 lost just about all the flexibility that we mean to gain by generating the
 markup in theme files rather than in core. Your suggested implementation
 means that you have to override an entire file full of functions (like bp-
 dir-search.php) in order to make a single change in your theme. Even if we
 modified this so that bits of markup were in their own functions (maybe
 with `function_exists()` wrappers), it still seems to me to fall short of
 our goal of moving everything into *template* files.

 Here's an idea. Let's move all these search forms etc into proper template
 parts. We maintain the existing functions in core for generating the
 markup. Then, the template parts will have the following structure:

 {{{#!php
 <?php if ( has_filter( 'bp_directory_members_search_form' ) ) : ?>
     <?php bp_directory_members_search_form(); ?>
 <?php else : ?>

     Put our new and improved markup here

 <?php endif; ?>
 }}}

 This way, we maintain backward compatibility with filters, while still
 using the well-known technique of template parts that can be overridden in
 a theme. All the `locate_includes()` stuff is then subsumed under the
 normal `bp_get_template_part()` template stack logic.

 What do you think?

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


More information about the buddypress-trac mailing list