[buddypress-trac] [BuddyPress Trac] #6588: Members Type - needs a template stack hierarchy entry

buddypress-trac noreply at wordpress.org
Wed Aug 12 21:23:03 UTC 2015


#6588: Members Type - needs a template stack hierarchy  entry
--------------------------------+------------------
 Reporter:  hnla                |       Owner:
     Type:  enhancement         |      Status:  new
 Priority:  normal              |   Milestone:  2.4
Component:  API - Theme Compat  |     Version:
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |
--------------------------------+------------------

Comment (by imath):

 i think we need to check `if ( '' !== bp_get_current_member_type() )`
 before adding it to the stack else we could have
 `index-directory-.php`

 and for the single template we should have something like :

 {{{
 $new_templates = array(
         /* existing templates */
 );

 // Make sure some member types are registered
 if ( bp_get_member_types() ) {
         // None is the member as no member type
         $type = 'none';

         if ( bp_get_member_type( bp_displayed_user_id() ) ) {
                 $type = sanitize_file_name( bp_get_member_type(
 bp_displayed_user_id() );
         }

         $new_templates[] = 'members/single/index-type-' . $type . '.php';
 }

 $new_templates = apply_filters(
 'bp_template_hierarchy_members_single_item', array_merge(
         $new_templates,
         array( 'members/single/index.php' )
 ) );
 }}}

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


More information about the buddypress-trac mailing list