Exemple #1
0
function Form_maker_fornt_end_main($content)
{
    $pattern = '[\\[Form id="([0-9]*)"\\]]';
    $count_forms_in_post = preg_match_all($pattern, $content, $matches_form);
    for ($jj = 0; $jj < $count_forms_in_post; $jj++) {
        $padron = $matches_form[0][$jj];
        $replacment = form_maker_front_end($matches_form[1][$jj]);
        $content = str_replace($padron, $replacment, $content);
    }
    return $content;
}
 function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', $instance['title']);
     // Before widget
     echo $before_widget;
     // Title of widget
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     global $form_maker_function__once;
     if ($form_maker_function__once) {
         $form_maker_function__once = 0;
     }
     require_once "front_end_form_maker.php";
     echo form_maker_front_end($instance['form_id']);
     // After widget
     echo $after_widget;
 }