/** * Echoes the widget content. * Sub-classes can over-ride this method to generate their widget code * but it is best to override front_end(). * * @param array $args Display arguments including 'before_title', 'after_title', * 'before_widget', and 'after_widget'. * @param array $instance The settings for the particular instance of the widget. */ public function widget($args, $instance) { // prepare $instance values for complex fields if (!empty($this->complex_field_names)) { $instance = self::unwrap_complex_field_values($instance, $this->complex_field_names); } // prepare $instance values for association fields foreach ($instance as &$field_value) { $field_value = Helper::parse_relationship_field($field_value); } // output if ($this->print_wrappers) { echo $args['before_widget']; } $this->front_end($args, $instance); if ($this->print_wrappers) { echo $args['after_widget']; } }