public function widget($args, $instance) { $title = apply_filters('Simple Contact Forms', $instance['form_title']); // before and after widget arguments are defined by themes echo $args['before_widget']; if (!empty($title)) { $title = '<h2>' . $title . '</h2>'; } // This is where you run the code and display the output $options = array('button' => $instance['button'] ? true : false, 'form_title' => $instance['form_title'], 'btn_text' => $instance['button_text'], 'form_collapse' => $instance['form_collapse'] ? true : false, 'email_subject' => $instance['email_subject']); simple_contact_form($options); echo $args['after_widget']; }
<div class="contacto_in"> <h2>Contáctanos</h2> <p>¡Hola! Si estás interesado en nuestros servicios o sólo quieres saludarnos déjanos un mensaje aquí o escríbenos a: <a href="mailto:hola@dos57.com">hola@dos57.com</a></p> </div> <?php if (function_exists('simple_contact_form')) { simple_contact_form(); }
/** * Initialize the view on the frontend with a shortcode * * @since 1.0.0 */ public function shortcode($sc_options = array()) { simple_contact_form($sc_options); }
/** * Get the Simple Contact Forms section. * @return String Final string of this section */ private function getSection_simple_contact_forms() { if (!function_exists('simple_contact_form')) { return ''; } $options = array(); if (get_sub_field('form_title') !== '') { $options['form_title'] = get_sub_field('form_title'); } if (get_sub_field('button') == true) { $options['button'] = true; $options['form_collapsed'] = true; if (get_sub_field('btn_text') !== '') { $options['btn_text'] = get_sub_field('btn_text'); } } if (get_sub_field('email_subject') !== '') { $options['email_subject'] = get_sub_field('email_subject'); } $options['return'] = true; $html = simple_contact_form($options); return $html; }