Ejemplo n.º 1
0
 /**
  * Alias for native get_theme_mod(Village::get_key('some_option'));
  *
  * @param  (string) $option to et
  *
  * @return (mixed)  Option returned
  */
 public static function get_theme_mod($option, $default = false)
 {
     // Get the options, if they aren't here yet
     global $wp_customize;
     if (self::$options === false || isset($wp_customize)) {
         self::$options = get_option(self::$key);
     }
     if (in_the_loop() || is_singular()) {
         $meta_value = self::get_post_meta($option, "");
         if ($meta_value !== "" && $meta_value !== null) {
             return apply_filters('village_' . $option, $meta_value);
         }
     }
     // Check if this option is set
     if (isset(self::$options[$option])) {
         return apply_filters('village_' . $option, self::$options[$option]);
     }
     return apply_filters('village_' . $option, $default);
 }