/** * @param null $color ufc|color * * @return Upfront_UFC */ public static function init($color = null) { self::$_theme_colors = get_option('upfront_' . get_stylesheet() . '_theme_colors'); self::$_theme_colors = apply_filters('upfront_get_theme_colors', self::$_theme_colors, array('json' => true)); self::$_theme_colors = is_string(self::$_theme_colors) ? json_decode(self::$_theme_colors) : self::$_theme_colors; self::$_theme_color_count = !empty(self::$_theme_colors->colors) ? count(self::$_theme_colors->colors) : 0; if (strpos($color, "ufc") !== false) { self::$_ufc = $color; } else { self::$_color = $color; } return new self(); }