/**
  * @since 1.2
  */
 function bp_add_template_stack_locations($stacks = array())
 {
     $retval = array();
     // Get alternate locations
     $locations = bp_get_template_locations();
     // Loop through locations and stacks and combine
     foreach ((array) $stacks as $stack) {
         foreach ((array) $locations as $custom_location) {
             $retval[] = untrailingslashit(trailingslashit($stack) . $custom_location);
         }
     }
     return apply_filters('bp_add_template_stack_locations', array_unique($retval), $stacks);
 }
/**
 * Add template locations to template files being searched for.
 *
 * @since 1.7.0
 *
 * @param array $stacks Array of template locations.
 *
 * @return array() Array of all template locations registered so far.
 */
function bp_add_template_stack_locations($stacks = array())
{
    $retval = array();
    // Get alternate locations
    $locations = bp_get_template_locations();
    // Loop through locations and stacks and combine
    foreach ((array) $stacks as $stack) {
        foreach ((array) $locations as $custom_location) {
            $retval[] = untrailingslashit(trailingslashit($stack) . $custom_location);
        }
    }
    /**
     * Filters the template locations to template files being searched for.
     *
     * @since 1.7.0
     *
     * @param array $value  Array of all template locations registered so far.
     * @param array $stacks Array of template locations.
     */
    return apply_filters('bp_add_template_stack_locations', array_unique($retval), $stacks);
}