function widget($args, $instance) { $cache = wp_cache_get('widget_nice_opening_hours', 'widget'); if (!is_array($cache)) { $cache = array(); } if (!isset($args['widget_id'])) { $args['widget_id'] = $this->id; } if (isset($cache[$args['widget_id']])) { echo $cache[$args['widget_id']]; return; } ob_start(); $settings = array_fill_keys($this->settings, ''); extract($args, EXTR_SKIP); $instance = wp_parse_args($instance, $settings); extract($instance, EXTR_SKIP); echo $before_widget; if ($title != '') { echo $before_title . apply_filters('widget_title', $title, $instance, $this->id_base) . $after_title; } // get times and do the magic! echo nice_opening_hours(); echo $after_widget; $cache[$args['widget_id']] = ob_get_flush(); wp_cache_set('widget_nice_opening_hours', $cache, 'widget'); }
} ?> </div> <div class="box"> <header> <h3><?php _e('Hours', 'nicethemes'); ?> </h3> </header> <?php echo nice_opening_hours(); ?> </div> </aside> <?php } ?> <div class="nice-contact-form"> <div class="entry">