public static function set_counter_script($script, $form_id, $field_id, $max_length)
 {
     $get_form = GFFormsModel::get_form_meta_by_id($form_id);
     $form = reset($get_form);
     $field_id_num = GF_Field_Repeater::get_field_id_number($field_id);
     if (GF_Field_Repeater::field_is_repeater_child($form, $field_id_num)) {
         $script = '';
     }
     return $script;
 }
Esempio n. 2
0
 public function init_frontend()
 {
     parent::init_frontend();
     GF_Field_Repeater::init_frontend();
 }
Esempio n. 3
0
 public static function get_children_parem_values($form, $children_ids)
 {
     global $wp_filter;
     $children_parems = GF_Field_Repeater::get_children_parems($form, $children_ids);
     if (empty($children_parems)) {
         return false;
     }
     // Check the URL first
     foreach ($_GET as $url_key => $url_value) {
         $key = array_search($url_key, $children_parems);
         if ($key !== false) {
             $parems[$key][0] = $url_value;
         } else {
             $split_key = preg_split('/\\D+\\K/', $url_key);
             $key = array_search($split_key[0], $children_parems);
             if ($key !== false) {
                 $parems[$key][$split_key[1]] = $url_value;
             }
         }
     }
     // Then check the filters
     foreach ($wp_filter as $key => $value) {
         $split_key = preg_split('/^gform_field_value_+\\K/', $key);
         if (!empty($split_key[1])) {
             $key1 = array_search($split_key[1], $children_parems);
             if ($key1 !== false) {
                 $parems[$key1][0] = apply_filters($key, '');
             } else {
                 $split_key2 = preg_split('/\\D+\\K/', $split_key[1]);
                 $key2 = array_search($split_key2[0], $children_parems);
                 if ($key2 !== false) {
                     $parems[$key2][$split_key2[1]] = apply_filters($key, '');
                 }
             }
         }
     }
     if (!empty($parems)) {
         return $parems;
     } else {
         return false;
     }
 }