コード例 #1
0
ファイル: template-functions.php プロジェクト: hscale/webento
/**
 * Add template locations to template files being searched for
 *
 * @since bbPress (r3738)
 *
 * @param array $templates
 * @return array() 
 */
function bbp_add_template_locations($templates = array())
{
    $retval = array();
    // Get alternate locations
    $locations = bbp_get_template_locations($templates);
    // Loop through locations and templates and combine
    foreach ((array) $locations as $location) {
        foreach ((array) $templates as $template) {
            $retval[] = ltrim(trailingslashit($location) . $template, '/');
        }
    }
    return apply_filters('bbp_add_template_locations', array_unique($retval), $templates);
}
コード例 #2
0
/**
 * Add template locations to template files being searched for
 *
 * @since bbPress (r3738)
 *
 * @param array $templates
 * @return array()
 */
function bbp_add_template_stack_locations($stacks = array())
{
    $retval = array();
    // Get alternate locations
    $locations = bbp_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('bbp_add_template_stack_locations', array_unique($retval), $stacks);
}
コード例 #3
0
/**
 * Add template locations to template files being searched for
 *
 * @since bbPress (r3738)
 *
 * @param array $templates
 * @return array() 
 */
function bbp_add_template_locations($templates = array())
{
    $retval = array();
    // Get alternate locations
    $locations = bbp_get_template_locations($templates);
    // Loop through locations and templates and combine
    foreach ($locations as $location) {
        foreach ($templates as $template) {
            $retval[] = trailingslashit($location) . $template;
        }
    }
    return apply_filters('bbp_add_template_locations', $retval, $templates);
}