function custom_form_generate($atts) { global $wpdb; //allows us to have database tables access extract(shortcode_atts(array('invoice_name' => 'stuff', 'invoice_type_id' => 'stuff'), $atts, 'cfg')); set_external_js_css($invoice_type_id); // add linked js and css files /* Form Validation/Submission Handler */ if ($_POST) { if ($invoice_type_id != 17) { $error_messages = custom_form_generate_validation($invoice_type_id); $form .= $error_messages; //output error messages } if (!$error_messages) { $form .= handle_submission($invoice_type_id); } } // if $_POST if (!$_POST || $_POST && $error_messages) { $form .= display_form($invoice_type_id); } return $form; }
/** * Displays the content for the FAQs tab * the form and the faq loop * * @since 3.0.0 */ function faq_tab_content() { //handle the submission if it posted if (isset($_POST['submit_faq']) && $_POST['submit_faq']) { $result = handle_submission(); } //the faqs loop include __DIR__ . '/templates/loop-faqs.php'; $disable_ask = get_option(WOOFAQS_OPTIONS_PREFIX . '_disable_ask', false); if (!$disable_ask || $disable_ask === 'no') { //the faq form include __DIR__ . '/templates/faq-form.php'; } }