Skip to:
Content

BuddyPress.org

Changeset 11151


Ignore:
Timestamp:
09/22/2016 12:47:30 AM (3 years ago)
Author:
r-a-y
Message:

Groups: Add current group type to group directory template hierarchy.

See #7210.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/classes/class-bp-groups-theme-compat.php

    r11145 r11151  
    8484     */
    8585    public function directory_template_hierarchy( $templates ) {
     86        // Set up the template hierarchy.
     87        $new_templates = array();
     88        if ( '' !== bp_get_current_group_directory_type() ) {
     89            $new_templates[] = 'groups/index-directory-type-' . sanitize_file_name( bp_get_current_group_directory_type() ) . '.php';
     90        }
     91        $new_templates[] = 'groups/index-directory.php';
    8692
    8793        /**
     
    9298         * @param array $value Array of default template files to use.
    9399         */
    94         $new_templates = apply_filters( 'bp_template_hierarchy_groups_directory', array(
    95             'groups/index-directory.php'
    96         ) );
     100        $new_templates = apply_filters( 'bp_template_hierarchy_groups_directory', $new_templates );
    97101
    98102        // Merge new templates with existing stack.
Note: See TracChangeset for help on using the changeset viewer.