function widget($args, $instance) { extract($args); $location = isset($instance['location']) ? $instance['location'] : false; $owm_city_id = isset($instance['owm_city_id']) ? $instance['owm_city_id'] : false; $override_title = isset($instance['override_title']) ? $instance['override_title'] : false; $widget_title = isset($instance['widget_title']) ? $instance['widget_title'] : false; $units = isset($instance['units']) ? $instance['units'] : false; $size = isset($instance['size']) ? $instance['size'] : false; $forecast_days = isset($instance['forecast_days']) ? $instance['forecast_days'] : false; $hide_stats = (isset($instance['hide_stats']) and $instance['hide_stats'] == 1) ? 1 : 0; $show_link = (isset($instance['show_link']) and $instance['show_link'] == 1) ? 1 : 0; $background_by_weather = (isset($instance['background_by_weather']) and $instance['background_by_weather'] == 1) ? 1 : 0; $background = isset($instance['background']) ? $instance['background'] : false; $custom_bg_color = isset($instance['custom_bg_color']) ? $instance['custom_bg_color'] : false; $text_color = isset($instance['text_color']) ? $instance['text_color'] : "#ffffff"; echo $before_widget; if ($widget_title != "") { echo $before_title . $widget_title . $after_title; } echo awesome_weather_logic(array('location' => $location, 'owm_city_id' => $owm_city_id, 'override_title' => $override_title, 'size' => $size, 'units' => $units, 'forecast_days' => $forecast_days, 'hide_stats' => $hide_stats, 'show_link' => $show_link, 'background' => $background, 'custom_bg_color' => $custom_bg_color, 'background_by_weather' => $background_by_weather, 'text_color' => $text_color)); echo $after_widget; }
function awesome_weather_shortcode($atts) { return awesome_weather_logic($atts); }