function woochimp_form() { $opt = get_option('woochimp_options', $results); // Check if integration is enabled if (!$opt || !is_array($opt) || empty($opt) || !isset($opt['woochimp_enabled_shortcode']) || !$opt['woochimp_enabled_shortcode']) { return; } // Check if mailing list is selected if (!isset($opt['woochimp_list_shortcode']) || empty($opt['woochimp_list_shortcode'])) { return; } $html = woochimp_prepare_form($opt, 'shortcode'); echo $html; }
/** * Display subscription form in place of shortcode * * @access public * @param mixed $attributes * @return string */ public function subscription_shortcode($attributes) { // Check if functionality is enabled if (!$this->opt['woochimp_enabled'] || !$this->opt['woochimp_enabled_shortcode']) { return ''; } // Prepare form $form = woochimp_prepare_form($this->opt, 'shortcode'); return $form; }