/** * Display the whole thang * * @param array $data */ public function display($data = array()) { $template = new \SimpleSubscribe\Template('adminApi.latte'); $templateGuts = $this->hasMessages() ? $this->getMessages() : \SimpleSubscribe\FrontEnd::unsubscriptionForm(); $templateAction = $this->hasMessages() ? 'Confirm Subscription' : 'Unsubscribe'; $templateBackUrl = $this->settings->getBackLinkUrl(); $defaults = array('action' => $templateAction, 'stylesheetUrl' => SUBSCRIBE_ASSETS . 'styleApi.css', 'guts' => $templateGuts, 'backLink' => '<a href="' . $templateBackUrl . '">Back to homepage »</a>'); $template->prepareTemplate($defaults, $data); echo $template->getTemplate(); }
/** * Unsubscription form shortcode */ public static function unsubscriptionForm() { $template = \SimpleSubscribe\FrontEnd::unsubscriptionForm(FALSE); echo $template; }
/** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget($args, $instance) { $template = FrontEnd::unsubscriptionForm(TRUE, array_merge($args, $instance)); echo $template; }