diff --git src/bp-core/bp-core-template-loader.php src/bp-core/bp-core-template-loader.php
index a4750638a..26c64edb6 100644
|
|
|
defined( 'ABSPATH' ) || exit; |
| 19 | 19 | * |
| 20 | 20 | * @since 1.7.0 |
| 21 | 21 | * |
| 22 | | * @param string $slug Template part slug. Used to generate filenames, |
| 23 | | * eg 'friends' for 'friends.php'. |
| 24 | | * @param string|null $name Optional. Template part name. Used to generate |
| 25 | | * secondary filenames, eg 'personal' for 'activity-personal.php'. |
| | 22 | * @param string $slug Template part slug. Used to generate filenames, |
| | 23 | * eg 'friends' for 'friends.php'. |
| | 24 | * @param string|null $name Optional. Template part name. Used to generate |
| | 25 | * secondary filenames, eg 'personal' for 'activity-personal.php'. |
| | 26 | * @param bool|null $load Optional. If true, the template file will be loaded when |
| | 27 | * found. If false, the path will be returned. Default: true. |
| | 28 | * @param bool|null $require_once Optional. Whether to require_once or require. Has |
| | 29 | * no effect if $load is false. Default: false. |
| 26 | 30 | * @return false|string Path to located template. See {@link bp_locate_template()}. |
| 27 | 31 | */ |
| 28 | | function bp_get_template_part( $slug, $name = null ) { |
| | 32 | function bp_get_template_part( $slug, $name = null, $load = true, $require_once = false ) { |
| 29 | 33 | |
| 30 | 34 | /** |
| 31 | 35 | * Fires at the start of bp_get_template_part(). |
| … |
… |
function bp_get_template_part( $slug, $name = null ) { |
| 58 | 62 | $templates = apply_filters( 'bp_get_template_part', $templates, $slug, $name ); |
| 59 | 63 | |
| 60 | 64 | // Return the part that is found. |
| 61 | | return bp_locate_template( $templates, true, false ); |
| | 65 | return bp_locate_template( $templates, $load, $require_once ); |
| 62 | 66 | } |
| 63 | 67 | |
| 64 | 68 | /** |
| … |
… |
function bp_locate_template( $template_names, $load = false, $require_once = tru |
| 105 | 109 | // No file found yet. |
| 106 | 110 | $located = false; |
| 107 | 111 | $template_locations = bp_get_template_stack(); |
| 108 | | |
| 109 | 112 | // Try to find a template file. |
| 110 | 113 | foreach ( (array) $template_names as $template_name ) { |
| 111 | 114 | |
diff --git src/bp-templates/bp-nouveau/includes/ajax.php src/bp-templates/bp-nouveau/includes/ajax.php
index bbefca7bc..f4e30c2ef 100644
|
|
|
function bp_nouveau_ajax_object_template_loader() { |
| 103 | 103 | switch ( $template ) { |
| 104 | 104 | case 'group_members' : |
| 105 | 105 | case 'groups/single/members' : |
| 106 | | $template_part = 'groups/single/members-loop.php'; |
| | 106 | $template_part = 'groups/single/members-loop'; |
| 107 | 107 | break; |
| 108 | 108 | |
| 109 | 109 | case 'group_requests' : |
| 110 | | $template_part = 'groups/single/requests-loop.php'; |
| | 110 | $template_part = 'groups/single/requests-loop'; |
| 111 | 111 | break; |
| 112 | 112 | |
| 113 | 113 | case 'friend_requests' : |
| 114 | | $template_part = 'members/single/friends/requests-loop.php'; |
| | 114 | $template_part = 'members/single/friends/requests-loop'; |
| 115 | 115 | break; |
| 116 | 116 | |
| 117 | 117 | case 'member_notifications' : |
| 118 | | $template_part = 'members/single/notifications/notifications-loop.php'; |
| | 118 | $template_part = 'members/single/notifications/notifications-loop'; |
| 119 | 119 | break; |
| 120 | 120 | |
| 121 | 121 | default : |
| 122 | | $template_part = $object . '/' . $object . '-loop.php'; |
| | 122 | $template_part = $object . '/' . $object . '-loop'; |
| 123 | 123 | break; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | ob_start(); |
| 127 | 127 | |
| 128 | | $template_path = bp_locate_template( array( $template_part ), false ); |
| | 128 | $template_path = bp_get_template_part( $template_part, null, false ); |
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | 131 | * Filters the server path for the template loader. |