Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/25/2018 08:25:49 PM (4 years ago)
Author:
djpaul
Message:

Templates: improvements to template loading methods.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.9/src/bp-templates/bp-legacy/buddypress-functions.php

    r11774 r11822  
    805805        bp_update_is_directory( true, bp_current_component() );
    806806
    807     $template_part = $object . '/' . $object . '-loop';
    808 
    809807    // The template part can be overridden by the calling JS function.
    810     if ( ! empty( $_POST['template'] ) ) {
    811         $template_part = sanitize_option( 'upload_path', $_POST['template'] );
    812     }
    813 
    814     // Locate the object template.
    815     bp_get_template_part( $template_part );
     808    if ( ! empty( $_POST['template'] ) && 'groups/single/members' === $_POST['template'] && 'group_members' === $object ) {
     809        $template_part = 'groups/single/members.php';
     810    } else {
     811        $template_part = $object . '/' . $object . '-loop.php';
     812    }
     813
     814    $template_path = bp_locate_template( array( $template_part ), false );
     815
     816    $template_path = apply_filters( 'bp_legacy_object_template_path', $template_path );
     817
     818    load_template( $template_path );
    816819    exit();
    817820}
Note: See TracChangeset for help on using the changeset viewer.