コード例 #1
0
        function ci_custom_background()
        {
            if (ci_setting('bg_custom_disabled') != 'enabled' or ci_setting('bg_h_custom_disabled') != 'enabled' and get_ci_theme_support('custom_header_background') or ci_setting('bg_f_custom_disabled') != 'enabled' and get_ci_theme_support('custom_footer_background')) {
                ?>
				<style type="text/css">
					<?php 
                if (ci_setting('bg_h_custom_disabled') != 'enabled' and get_ci_theme_support('custom_header_background')) {
                    $custom_bg_h = array('bg_h_color' => apply_filters('ci_background_color_value', ci_setting('bg_h_color')), 'bg_h_image' => ci_setting('bg_h_image'), 'bg_h_image_horizontal' => ci_setting('bg_h_image_horizontal'), 'bg_h_image_vertical' => ci_setting('bg_h_image_vertical'), 'bg_h_image_attachment' => ci_setting('bg_h_image_attachment'), 'bg_h_image_repeat' => ci_setting('bg_h_image_repeat'), 'bg_h_image_disable' => ci_setting('bg_h_image_disable'), 'bg_h_image_size' => ci_setting('bg_h_image_size') != 'custom' ? ci_setting('bg_h_image_size') : ci_setting('bg_h_image_size_value'));
                    do_action('ci_custom_header_background', apply_filters('ci_custom_header_background_options', $custom_bg_h));
                }
                if (ci_setting('bg_custom_disabled') != 'enabled') {
                    $custom_bg = array('bg_color' => apply_filters('ci_background_color_value', ci_setting('bg_color')), 'bg_image' => ci_setting('bg_image'), 'bg_image_horizontal' => ci_setting('bg_image_horizontal'), 'bg_image_vertical' => ci_setting('bg_image_vertical'), 'bg_image_attachment' => ci_setting('bg_image_attachment'), 'bg_image_repeat' => ci_setting('bg_image_repeat'), 'bg_image_disable' => ci_setting('bg_image_disable'), 'bg_image_size' => ci_setting('bg_image_size') != 'custom' ? ci_setting('bg_image_size') : ci_setting('bg_image_size_value'));
                    do_action('ci_custom_background', apply_filters('ci_custom_background_options', $custom_bg));
                }
                if (ci_setting('bg_f_custom_disabled') != 'enabled' and get_ci_theme_support('custom_footer_background')) {
                    $custom_bg_f = array('bg_f_color' => apply_filters('ci_background_color_value', ci_setting('bg_f_color')), 'bg_f_image' => ci_setting('bg_f_image'), 'bg_f_image_horizontal' => ci_setting('bg_f_image_horizontal'), 'bg_f_image_vertical' => ci_setting('bg_f_image_vertical'), 'bg_f_image_attachment' => ci_setting('bg_f_image_attachment'), 'bg_f_image_repeat' => ci_setting('bg_f_image_repeat'), 'bg_f_image_disable' => ci_setting('bg_f_image_disable'), 'bg_f_image_size' => ci_setting('bg_f_image_size') != 'custom' ? ci_setting('bg_f_image_size') : ci_setting('bg_f_image_size_value'));
                    do_action('ci_custom_footer_background', apply_filters('ci_custom_footer_background_options', $custom_bg_f));
                }
                ?>
				</style>
			<?php 
            }
            ?>
			<?php 
        }
コード例 #2
0
 function ci_pcsc_update_post_meta($post_id)
 {
     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
         return;
     }
     if (isset($_POST['post_view']) and $_POST['post_view'] == 'list') {
         return;
     }
     $post_types = get_ci_theme_support('post-color-scheme');
     if (is_array($post_types) && isset($_POST['post_type']) && in_array($_POST['post_type'], $post_types)) {
         update_post_meta($post_id, "ci_pcsc_stylesheet", isset($_POST["ci_pcsc_stylesheet"]) ? $_POST["ci_pcsc_stylesheet"] : '');
     }
 }
コード例 #3
0
            $instance = $old_instance;
            $instance['ci_title'] = sanitize_text_field($new_instance['ci_title']);
            $instance['ci_username'] = sanitize_text_field($new_instance['ci_username']);
            $instance['ci_number'] = absint($new_instance['ci_number']);
            $instance['ci_title'] = ci_register_string_translation('Twitter - Title', $instance['ci_title'], 'Widgets');
            return $instance;
        }
        // widget form
        function form($instance)
        {
            $instance = wp_parse_args((array) $instance, array('ci_title' => '', 'ci_username' => '', 'ci_number' => ''));
            if (ci_setting('twitter_consumer_key') == '' or ci_setting('twitter_consumer_secret') == '' or ci_setting('twitter_access_token') == '' or ci_setting('twitter_access_token_secret') == '') {
                echo '<p>' . __("It looks like you haven't provided Twitter access details, in order for this widget to work. Unfortunately, this is needed. Please visit the theme's settings page and provide the required access details.", 'ci_theme') . '</p>';
            } else {
                $ci_title = $instance['ci_title'];
                $ci_username = $instance['ci_username'];
                $ci_number = $instance['ci_number'];
                echo '<p><label for="' . esc_attr($this->get_field_id('ci_title')) . '">' . __('Title:', 'ci_theme') . '</label><input id="' . esc_attr($this->get_field_id('ci_title')) . '" name="' . esc_attr($this->get_field_name('ci_title')) . '" type="text" value="' . esc_attr($ci_title) . '" class="widefat" /></p>';
                echo '<p><label for="' . esc_attr($this->get_field_id('ci_username')) . '">' . __('Username:'******'ci_theme') . '</label><input id="' . esc_attr($this->get_field_id('ci_username')) . '" name="' . esc_attr($this->get_field_name('ci_username')) . '" type="text" value="' . esc_attr($ci_username) . '" class="widefat" /></p>';
                echo '<p><label for="' . esc_attr($this->get_field_id('ci_number')) . '">' . __('Number of tweets:', 'ci_theme') . '</label><input id="' . esc_attr($this->get_field_id('ci_number')) . '" name="' . esc_attr($this->get_field_name('ci_number')) . '" type="text" value="' . esc_attr($ci_number) . '" class="widefat" /></p>';
            }
        }
    }
    // class
    // Check that the Twitter widget can be loaded.
    // Support is added automatically upon the inclusion of the twitter_api panel snippet.
    if (get_ci_theme_support('twitter_widget')) {
        register_widget('CI_Tweets');
    }
}
// !class_exists
コード例 #4
0
    _e('Select the pagination method to use:', 'ci_theme');
    ?>
</label>
		<?php 
    ci_panel_radio('pagination_method', 'paginate_links', 'paginate_links', __('Numbered pagination.', 'ci_theme'));
    ?>
		<?php 
    ci_panel_radio('pagination_method', 'prevnext', 'prevnext', __('"Previous - Next" links.', 'ci_theme'));
    ?>
		
		<?php 
    if (function_exists('wp_pagenavi')) {
        ?>

			<?php 
        if (get_ci_theme_support('wp_pagenavi') == false) {
            ?>
				<p class="guide mt10"><?php 
            _e("The theme has detected that you have installed the <strong>WP-PageNavi</strong> plugin. Although the theme doesn't provide appropriate styles for it, you can still use it without editing any files, by selecting the option below. However, you might need to configure and/or style it on your own.", 'ci_theme');
            ?>
</p>
			<?php 
        }
        ?>

			<?php 
        ci_panel_radio('pagination_method', 'wp_pagenavi', 'wp_pagenavi', __('WP-PageNavi plugin.', 'ci_theme'));
        ?>
		<?php 
    }
    ?>