예제 #1
0
 function setUp()
 {
     parent::setUp();
     /* Make sure the active theme is Distilled */
     switch_theme('Distilled');
     /* Include the Distilled function file and extensions */
     require_once '../../functions.php';
     include_once '../extensions/comments-extensions.php';
     include_once '../extensions/content-extensions.php';
     include_once '../extensions/discussion-extensions.php';
     include_once '../extensions/discussion.php';
     include_once '../extensions/dynamic-classes.php';
     include_once '../extensions/footer-extensions.php';
     include_once '../extensions/header-extensions.php';
     include_once '../extensions/helpers.php';
     include_once '../extensions/shortcodes.php';
     include_once '../extensions/sidebar-extensions.php';
     include_once '../extensions/theme-options.php';
     include_once '../extensions/widgets-extensions.php';
     include_once '../extensions/widgets.php';
     /* Setup the theme options */
     $this->theme_options = seamless_default_opt();
     $this->update_test_options('seamless_theme_opt', $this->theme_options);
     /* Define Distilled constants */
     define('THEMATIC_MB', false);
     if (defined('WP_TESTS_MULTISITE') && WP_TESTS_MULTISITE) {
         define('THEMATIC_MB', true);
     }
 }
예제 #2
0
 function seamless_validate_opt($input)
 {
     $output = seamless_get_wp_opt('seamless_theme_opt', seamless_default_opt());
     // Author Info CheckBox value either 1(yes) or 0(no)
     $output['author_info'] = isset($input['author_info']) && 1 == $input['author_info'] ? 1 : 0;
     // Footer Text sanitized allowing HTML and WP shortcodes
     if (isset($input['footer_txt'])) {
         $output['footer_txt'] = wp_kses_post($input['footer_txt']);
     }
     // Check and set layout
     if (isset($input['layout'])) {
         $available_layouts = seamless_available_layout_slugs();
         if (in_array($input['layout'], $available_layouts)) {
             $output['layout'] = $input['layout'];
         } else {
             $output['layout'] = seamless_default_theme_layout();
         }
     }
     return apply_filters('seamless_theme_opt_validation', $output, $input);
 }
예제 #3
0
	        <textarea rows="5" style="width:100%;" <?php 
            $this->link();
            ?>
><?php 
            echo esc_textarea($this->value());
            ?>
</textarea>
	        </label>
	        <?php 
        }
    }
    // Add postMessage support for site title and description.
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    // Get the default seamless footer text
    $seamless_defaults = seamless_default_opt();
    $seamless_default_footertext = $seamless_defaults['footer_txt'];
    $seamless_default_layout = $seamless_defaults['layout'];
    /**
     * Filter to show or hide the layout section from the Theme Customizer
     * 
     * @param bool true Default is showing the section
     */
    if (apply_filters('seamless_show_customizer_layoutsection', true) && !seamless_is_legacy_xhtml()) {
        $wp_customize->add_section('seamless_layout', array('title' => __('Layout', 'seamless'), 'description' => __('Choose the main layout of your theme', 'seamless'), 'capability' => 'edit_theme_options', 'priority' => '90'));
        $wp_customize->add_setting('seamless_theme_opt[layout]', array('default' => $seamless_default_layout, 'type' => 'option'));
        $possible_layouts = seamless_available_theme_layouts();
        $available_layouts = array();
        foreach ($possible_layouts as $layout) {
            $available_layouts[$layout['slug']] = $layout['title'];
        }