示例#1
0
function cultiv8_option($option, $default = false)
{
    if (class_exists('CTC_Extender') && ctcex_has_option($option)) {
        return ctcex_get_option($option, $default);
    }
    return get_theme_mod($option, $default);
}
示例#2
0
function cultiv8_get_option($option, $default = '')
{
    if (class_exists('CTC_Extender')) {
        return ctcex_get_option($option, $default);
    } else {
        $out = get_option($option, $default);
        return $out;
    }
}
示例#3
0
function cultiv8_feed_request($qv)
{
    if (!isset($qv['feed'])) {
        return $qv;
    }
    if (!isset($qv['post_type'])) {
        $qv['post_type'] = 'ctc_sermon';
    }
    $topic_option = ctcex_get_option('ctc-sermon-topic');
    if (!empty($topic_option) && !isset($qv['ctc_sermon_topic'])) {
        // Set the first location as the default
        $locs = get_terms('ctc_sermon_topic', array('order_by' => 'id', 'order' => 'DESC'));
        $def_loc = array_shift($locs);
        $def_loc = $def_loc->slug;
        if (!empty($def_loc)) {
            $qv['ctc_sermon_topic'] = $def_loc;
        }
    }
    return $qv;
}
示例#4
0
function harvest_ctc_sermon_pre_loop()
{
    global $wp_query;
    $query_term = $wp_query->query;
    if ('ctc_sermon' != $query_term['post_type']) {
        return;
    }
    $args = array('order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => 9);
    $topic_option = ctcex_get_option('ctc-sermon-topic');
    if (!empty($topic_option) && !isset($qv['ctc_sermon_topic'])) {
        // Set the first location as the default
        $locs = get_terms('ctc_sermon_topic', array('order_by' => 'id', 'order' => 'DESC'));
        $first_loc = array_shift($locs);
        $min_loc_slug = $first_loc->slug;
        if (!empty($min_loc_slug)) {
            $tax_query = array(array('taxonomy' => 'ctc_sermon_topic', 'field' => 'slug', 'terms' => $min_loc_slug));
            $args['tax_query'] = $tax_query;
        }
    }
    $query_term = array_merge($args, $query_term);
    $wp_query = new WP_Query($query_term);
}
示例#5
0
function harvest_option($option, $default = false)
{
    if (class_exists('CTC_Extender') && ctcex_has_option($option)) {
        return ctcex_get_option($option, $default);
    }
    $theme_data = wp_get_theme();
    $theme_safename = sanitize_title($theme_data);
    $options = get_option($theme_safename . '-options');
    if (isset($options[$option])) {
        return $options[$option];
    } else {
        return $default;
    }
}