Ejemplo n.º 1
0
 /**
  * Return default value
  *
  * @param string $key
  * @return null|string
  */
 public static function get_default($key)
 {
     self::$defaults = apply_filters('habakiri_theme_mods_defaults', array('logo' => '', 'logo_text_color' => '#000', 'header' => 'header--default', 'header_fixed' => '', 'footer_columns' => 'col-md-4', 'blog_template' => 'right-sidebar', 'search_template' => 'right-sidebar', '404_template' => 'right-sidebar', 'is_displaying_thumbnail' => 'true', 'is_displaying_bread_crumb' => 'true', 'is_displaying_related_posts' => 'true', 'is_displaying_page_header' => 'true', 'is_displaying_page_header_lead' => 'true', 'link_color' => '#337ab7', 'link_hover_color' => '#23527c', 'gnav_bg_color' => '#fff', 'gnav_link_color' => '#000', 'gnav_link_hover_color' => '#337ab7', 'gnav_link_bg_color' => '#fff', 'gnav_link_bg_hover_color' => '#fff', 'gnav_sub_label_color' => '#777', 'gnav_sub_label_hover_color' => '#777', 'gnav_pulldown_link_color' => '#777', 'gnav_pulldown_link_hover_color' => '#337ab7', 'gnav_pulldown_bg_color' => '#000', 'gnav_pulldown_bg_hover_color' => '#191919', 'offcanvas_nav_fontsize' => 12, 'offcanvas_nav_direction' => 'right', 'hamburger_btn_text_color' => '#000', 'hamburger_btn_text_hover_color' => '#000', 'hamburger_btn_border_color' => '#eee', 'hamburger_btn_border_hover_color' => '#eee', 'hamburger_btn_bg_color' => '#fff', 'hamburger_btn_bg_hover_color' => '#f5f5f5', 'header_bg_color' => '#fff', 'footer_bg_color' => '#111113', 'footer_text_color' => '#555', 'footer_link_color' => '#777', 'page_header_bg_color' => '#222', 'page_header_text_color' => '#fff', 'gnav_breakpoint' => 'md', 'gnav_fontsize' => 12, 'gnav_sub_label_fontsize' => 10, 'gnav_link_horizontal_padding' => 15, 'gnav_link_vertical_padding' => 23, 'slider_option_effect' => 'horizontal', 'slider_option_interval' => 4000, 'slider_option_speed' => 500, 'slider_option_overlay_color' => '#000', 'slider_option_overlay_opacity' => '90', 'slider_option_height' => 0, 'slider_option_target_1' => false, 'slider_option_target_2' => false, 'slider_option_target_3' => false, 'slider_option_target_4' => false, 'slider_option_target_5' => false, 'excerpt_length' => get_locale() == 'ja' ? 110 : 220));
     if (isset(self::$defaults[$key])) {
         return self::$defaults[$key];
     }
 }
Ejemplo n.º 2
0
 /**
  * デフォルト値を取得
  *
  * @param string $key
  * @return null|string
  */
 public static function get_default($key)
 {
     self::$defaults = apply_filters('habakiri_theme_mods_defaults', array('logo' => '', 'logo_text_color' => '#000', 'header' => 'header--default', 'header_fixed' => '', 'footer_columns' => 'col-md-4', 'blog_template' => 'right-sidebar', 'search_template' => 'right-sidebar', '404_template' => 'right-sidebar', 'is_displaying_thumbnail' => 'true', 'is_displaying_bread_crumb' => 'true', 'is_displaying_related_posts' => 'true', 'is_displaying_page_header' => 'true', 'is_displaying_page_header_lead' => 'true', 'link_color' => '#337ab7', 'link_hover_color' => '#23527c', 'gnav_link_color' => '#000', 'gnav_link_hover_color' => '#337ab7', 'gnav_pulldown_link_color' => '#777', 'gnav_pulldown_bg_color' => '#000', 'gnav_pulldown_bg_hover_color' => '#191919', 'header_bg_color' => '#fff', 'footer_bg_color' => '#111113', 'footer_text_color' => '#555', 'footer_link_color' => '#777', 'page_header_bg_color' => '#222', 'page_header_text_color' => '#fff'));
     if (isset(self::$defaults[$key])) {
         return self::$defaults[$key];
     }
 }
Ejemplo n.º 3
0
 /**
  * Return the theme option
  *
  * @param string $key
  * @return null|string
  */
 public static function get($key)
 {
     $default = Habakiri_Customizer::get_default($key);
     $theme_mod = get_theme_mod($key, $default);
     return $theme_mod;
 }
Ejemplo n.º 4
0
 /**
  * テーマオプションを取得
  *
  * @param string $key
  * @return null|string
  */
 public static function get($key)
 {
     $default = Habakiri_Customizer::get_default($key);
     $theme_mod = get_theme_mod($key);
     /**
      * backward compatible
      * @since 1.2.0
      */
     if (in_array($key, array('header', 'header_fixed')) && !empty($theme_mod)) {
         $theme_mod = preg_replace('/^header\\-([^\\-])/', 'header--$1', $theme_mod);
     }
     if ($theme_mod) {
         return $theme_mod;
     }
     return $default;
 }