Ejemplo n.º 1
0
 /**
  * Generates semantic classes for BODY element
  *
  * @param array $classes body classes
  */
 function seamless_body_class($classes)
 {
     /**
      * Filter to control the theme layout
      *
      * Accepts any string that is part of seamless_available_theme_layouts(). Note that
      * the filter overrides the layout defined in the Theme Customizer. Any invalid
      * layout string will be ignored and the theme's default layout will be used.
      *
      * @see seamless_available_theme_layouts()
      *
      * @since 2.0
      *
      * @param string $current_layout
      */
     $current_layout = apply_filters('seamless_current_theme_layout', seamless_get_theme_opt('layout'));
     if (is_page_template('template-page-fullwidth.php')) {
         $classes[] = 'full-width';
     } elseif (in_array($current_layout, seamless_available_layout_slugs())) {
         $classes[] = $current_layout;
     } else {
         $classes[] = seamless_default_theme_layout();
     }
     /**
      * Filter the body classes
      * 
      * @param array $classes
      */
     return apply_filters('seamless_body_class', $classes);
 }
Ejemplo n.º 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);
 }