40 | | if ($bp->bp_options_nav[$component][$action]['user_has_access'] == true) |
| 40 | // create template list to search for in order |
| 41 | // looks first for a new template file that is name but lowercase with spaces replaced to hyphen |
| 42 | // then looks for the slug. This will allow it to return to initial tab without loading double menu |
| 43 | $templates = array(); |
| 44 | $templates[] = 'members/single/'.$component.'/'.$tab_name.'.php'; |
| 45 | $templates[] = 'members/single/'.$component.'/'.$slug.'.php'; |
| 46 | |
| 47 | // check user has permission to view template part |
| 48 | if ($bp->bp_options_nav[$component][$slug]['user_has_access'] == true) |
42 | | // they are allowed to view it so return template |
43 | | bp_get_template_part( $path ); |
44 | | exit( '0' ); |
| 50 | do_action( 'get_template_part_' . $slug, $slug, '' ); |
| 51 | // Execute code for this ajax tab template part |
| 52 | /** |
| 53 | * Fires before ajax tab template part is loaded. |
| 54 | * |
| 55 | * This is a variable hook that is dependent on the slug passed in. |
| 56 | * |
| 57 | * @param string $slug The tabs slug. |
| 58 | * @param string $name The tabs name, lower case with space replaced with hyphens. |
| 59 | */ |
| 60 | do_action( 'get_template_ajax_tab_' . $slug, $slug, $tab_name ); |
| 61 | |
| 62 | // allow ajax template part specific filtering |
| 63 | $templates = apply_filters( 'bp_get_template_part_ajax', $templates, $slug, $tab_name ); |
| 64 | |
| 65 | // Return the part that is found |
| 66 | bp_locate_template( $templates, true, false ); |
| 67 | exit(); |