示例#1
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;
 }
示例#2
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;
 }