public function widget($arguments, $instance)
 {
     extract($arguments);
     $this->register_widgets();
     $instance = piklist::object_value($instance);
     $widget = $instance['widget'];
     if (!empty($widget)) {
         unset($instance['widget']);
         $this->widgets[$widget]['instance'] = $instance;
         piklist_widget::$current_widget = $this->widget_name;
         do_action('piklist_pre_render_widget', $this->widgets[$widget]);
         piklist::render($this->widgets[$widget]['path'], array('instance' => $instance, 'settings' => $instance, 'before_widget' => str_replace('class="', 'class="' . piklist::dashes($this->widgets[$widget]['add_on'] . ' ' . $this->widgets[$widget]['name']) . ' ' . $this->widgets[$widget]['data']['class'] . ' ', $before_widget), 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
         do_action('piklist_post_render_widget', $this->widgets[$widget]);
     }
 }
Ejemplo n.º 2
0
 /**
  * setup
  * Setup the current widget.
  *
  * @param string $widget The widget name.
  *
  * @access public
  * @since 1.0
  */
 public function setup($widget)
 {
     $this->register_widgets();
     piklist_widget::$current_widget = $widget;
 }