template = $template; } public function setDefault($default) { $this->default = __('Default:','maxbuttons') . ' ' . $default; } public function output($start_tpl = '', $end_tpl = '') { if ($this->esc_function) { $this->value = call_user_func($this->esc_function, $this->value); } $output = ''; if ($start_tpl != '') { $start_tpl = self::$templates[$start_tpl]; $output .= simpleTemplate::parse($start_tpl['path'], $this); } $template = self::$templates[$this->template]; // template name; do_action('mb/editor/before-field-' . $this->id, $this); $output .= simpleTemplate::parse($template['path'], $this); if ($end_tpl != '') { if (! is_array($end_tpl)) $end_tpl = array($end_tpl); foreach($end_tpl as $tpl) { $tpl = self::$templates[$tpl]; $output .= simpleTemplate::parse($tpl['path'], $this); } } if ($this->publish) echo $output; do_action('mb/editor/after-field-'. $this->id); // hook for extra fields. $this->output = $output; return $output; } }