Example #1
0
function arras_sanitize_layouts($value)
{
    $layouts = arras_get_layouts();
    if (!array_key_exists($value, $layouts)) {
        $value = '2c-r';
    }
    return $value;
}
Example #2
0
    $wp_customize->add_control(new Arras_Checkbox_Multi_Select($wp_customize, 'news-cat', array('label' => __('News Categories (or Terms)', 'arras'), 'section' => 'news', 'settings' => 'arras-options[news_cat]', 'type' => 'multiple-select', 'choices' => arras_get_terms(arras_get_option('news_tax'), arras_get_option('news_posttype')), 'priority' => 10)));
    $wp_customize->add_control('post-author', array('label' => __('Post Author', 'arras'), 'section' => 'post-meta', 'settings' => 'arras-options[post_author]', 'type' => 'checkbox', 'priority' => 1));
    $wp_customize->add_control('post-date', array('label' => __('Post Date', 'arras'), 'section' => 'post-meta', 'settings' => 'arras-options[post_date]', 'type' => 'checkbox', 'priority' => 2));
    $wp_customize->add_control('post-categories', array('label' => __('Post Categories', 'arras'), 'section' => 'post-meta', 'settings' => 'arras-options[post_cats]', 'type' => 'checkbox', 'priority' => 3));
    $wp_customize->add_control('post-tags', array('label' => __('Post Tags', 'arras'), 'section' => 'post-meta', 'settings' => 'arras-options[post_tags]', 'type' => 'checkbox', 'priority' => 4));
    $wp_customize->add_control('single-thumbnail', array('label' => __('Post Featured Image', 'arras'), 'section' => 'post-meta', 'settings' => 'arras-options[single_thumbs]', 'type' => 'checkbox', 'priority' => 5));
    $wp_customize->add_control('relative-postdates', array('label' => __('Use Relative Postdates', 'arras'), 'description' => __('Display post dates relative to current time, eg. 2 days ago. (Note: Posts over a month old will always show with the regular date format.) ', 'arras'), 'section' => 'post-meta', 'settings' => 'arras-options[relative_postdates]', 'type' => 'checkbox', 'priority' => 6));
    $wp_customize->add_control(new WP_Customize_Upload_Control($wp_customize, 'site_logo', array('label' => __('Site Logo', 'arras'), 'section' => 'header_image', 'settings' => 'arras-options[site_logo]', 'priority' => 1)));
    $wp_customize->add_control('show-rss', array('label' => __('Show RSS Feed Icon', 'arras'), 'description' => __('Your RSS feed URL is: ', 'arras') . '<br />' . get_bloginfo('rss2_url'), 'section' => 'social', 'settings' => 'arras-options[show_rss]', 'type' => 'checkbox', 'priority' => 1));
    $wp_customize->add_control('twitter', array('label' => __('Twitter URL', 'arras'), 'section' => 'social', 'settings' => 'arras-options[twitter]', 'type' => 'url', 'priority' => 2));
    $wp_customize->add_control('facebook', array('label' => __('Facebook URL', 'arras'), 'section' => 'social', 'settings' => 'arras-options[facebook]', 'type' => 'url', 'priority' => 3));
    $wp_customize->add_control('google', array('label' => __('Google+ URL', 'arras'), 'section' => 'social', 'settings' => 'arras-options[google]', 'type' => 'url', 'priority' => 4));
    $wp_customize->add_control('youtube', array('label' => __('YouTube URL', 'arras'), 'section' => 'social', 'settings' => 'arras-options[youtube]', 'type' => 'url', 'priority' => 5));
    $wp_customize->add_control('flickr', array('label' => __('Flickr URL', 'arras'), 'section' => 'social', 'settings' => 'arras-options[flickr]', 'type' => 'url', 'priority' => 6));
    $wp_customize->add_section('layout', array('title' => __('Layout', 'arras'), 'priority' => 110));
    $wp_customize->add_control('layout', array('label' => __('Sidebar Arrangement', 'arras'), 'section' => 'layout', 'settings' => 'arras-options[layout]', 'type' => 'select', 'choices' => arras_get_layouts(), 'priority' => 1));
    $wp_customize->add_control('default-tapestry', array('label' => __('Default Display Mode', 'arras'), 'section' => 'layout', 'settings' => 'arras-options[default_tapestry]', 'type' => 'select', 'choices' => arras_get_tapestry_choices(), 'priority' => 3));
    $wp_customize->add_control('auto-thumbs', array('label' => __('Auto-Thumbnail', 'arras'), 'description' => __('Automatically retrieve the first attached image from the post as featured image when no image is specified.', 'arras'), 'section' => 'layout', 'settings' => 'arras-options[auto_thumbs]', 'type' => 'checkbox', 'priority' => 2));
    $wp_customize->add_control('nodes-per-row', array('label' => __('Nodes per Row', 'arras'), 'description' => __('For Node-based Display Mode.', 'arras'), 'section' => 'layout', 'settings' => 'arras-options[nodes_per_row]', 'type' => 'select', 'choices' => arras_get_numerical_choice_array(12), 'priority' => 4));
    $wp_customize->add_control('nodes-excerpt', array('label' => __('Show Excerpts with Nodes', 'arras'), 'section' => 'layout', 'settings' => 'arras-options[nodes_excerpt]', 'type' => 'checkbox', 'priority' => 5));
    $wp_customize->add_control('excerpt-limit', array('label' => __('Excerpt Limit', 'arras'), 'description' => __('Number of words to trim excerpts. Trims only if no excerpt is specified for a post. Maximum 300 words. Enter 0 for no trim.', 'arras'), 'section' => 'layout', 'settings' => 'arras-options[excerpt_limit]', 'type' => 'number', 'priority' => 6));
    $wp_customize->add_control('footer-columns', array('label' => __('Footer Columns', 'arras'), 'description' => __('Each footer column gets its own widget area.', 'arras'), 'section' => 'layout', 'settings' => 'arras-options[footer_columns]', 'type' => 'select', 'choices' => arras_get_numerical_choice_array(4), 'priority' => 7));
    return $wp_customize;
}
// end arras_customizer()
function arras_get_settings_data()
{
    global $arras_colors;
    $color_scheme = $arras_colors->get_color_scheme_colors_array();
    /**
     * Settings data array