Esempio n. 1
0
        function widget($args, $instance)
        {
            /* Get Newsletter Sign-up options */
            $options = get_option('nsu_form');
            /* Provide some defaults */
            $defaults = array('title' => 'Sign up for our newsletter!', 'text_before_form' => '', 'text_after_form' => '');
            $instance = wp_parse_args((array) $instance, $defaults);
            extract($args);
            extract($instance);
            $title = apply_filters('widget_title', $title);
            echo $before_widget;
            echo $before_title . $title . $after_title;
            if (!empty($text_before_form)) {
                ?>
<div class="nsu-text-before-form"><?php 
                $instance['filter'] ? _e(wpautop($text_before_form), 'nsu-widget') : _e($text_before_form, 'nsu-widget');
                ?>
</div><?php 
            }
            NSU::form()->output_form(true);
            if (!empty($text_after_form)) {
                ?>
<div class="nsu-text-after-form"><?php 
                $instance['filter'] ? _e(wpautop($text_after_form), 'nsu-widget') : _e($text_after_form, 'nsu-widget');
                ?>
</div><?php 
            }
            echo $after_widget;
        }
Esempio n. 2
0
 public static function form()
 {
     if (!self::$form) {
         require_once NSU_PLUGIN_DIR . 'includes/NSU_Form.php';
         self::$form = new NSU_Form();
     }
     return self::$form;
 }
Esempio n. 3
0
	function nsu_form() {
		NSU::form()->output_form(true);
	}