예제 #1
0
function vanilla_load_widgets()
{
    global $tpl_set;
    $files = cfct_files(CFCT_PATH . $tpl_set . 'widgets');
    foreach ($files as $file) {
        include CFCT_PATH . $tpl_set . 'widgets/' . $file;
    }
}
예제 #2
0
/**
 * Get a list of files that match the comment template structure for a given type
 * 
 * @param string $type The type of template to search for
 * @param array $files A list of files to search through
 * @return array List of files that match the comment template structure for a given type
 * 
**/
function cfct_comment_templates($type, $files = false)
{
    if (!$files) {
        $files = cfct_files(CFCT_PATH . 'comment');
    }
    $matches = array();
    switch ($type) {
        case 'user':
            $matches = cfct_filter_files($files, 'user-');
            break;
        case 'role':
            $matches = cfct_filter_files($files, 'role-');
            break;
    }
    return apply_filters('cfct_comment_templates', $matches);
}
예제 #3
0
function vanilla_load_tpl_includes()
{
    global $tpl_set;
    // list of directories containing pairs of PHP/HTML template files. Include the PHP files now for later use...
    $dirs = array("shortcodes");
    foreach ($dirs as $dir) {
        // load template item from either parent or child theme
        $files = cfct_files(CFCT_PATH . $tpl_set . $dir);
        foreach ($files as $file) {
            include_once vanilla_get_template($dir . '/' . $file);
        }
    }
}
예제 #4
0
function cfcp_header_display_featured_post($slot, $post_id)
{
    if (empty($post_id)) {
        $file = 'empty';
    } else {
        $file = 'default';
        if ($post_format = get_post_format($post_id)) {
            // find files
            $format_files = cfct_files(CFCT_PATH . 'header/featured');
            // check for format file, or fall to default
            if (count($format_files) && in_array('format-' . $post_format . '.php', $format_files)) {
                $file = 'format-' . $post_format;
            }
        }
    }
    cfct_template_file('header/featured', $file, compact('slot', 'post_id'));
}