Skip to:
Content

Changeset 10218


Ignore:
Timestamp:
10/08/15 19:03:44 (2 years ago)
Author:
r-a-y
Message:

Members: Add member type to template hierarchy for members directory.

Props hnla, DJPaul, imath.

Fixes #6588.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-screens.php

    r10149 r10218  
    464464    public function directory_template_hierarchy( $templates = array() ) { 
    465465 
     466        // Set up the template hierarchy 
     467        $hierarchy = array(); 
     468        if ( '' !== bp_get_current_member_type() ) { 
     469            $hierarchy[] = 'members/index-directory-type-' . sanitize_file_name( bp_get_current_member_type() ) . '.php'; 
     470        } 
     471        $hierarchy[] = 'members/index-directory.php'; 
     472 
    466473        /** 
    467474         * Filters the template hierarchy for theme compat and members directory page. 
     
    471478         * @param array $value Array of template paths to add to hierarchy. 
    472479         */ 
    473         $new_templates = apply_filters( 'bp_template_hierarchy_members_directory', array( 
    474             'members/index-directory.php' 
    475         ) ); 
     480        $new_templates = apply_filters( 'bp_template_hierarchy_members_directory', $hierarchy ); 
    476481 
    477482        // Merge new templates with existing stack 
Note: See TracChangeset for help on using the changeset viewer.