Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'gform_field_input', 'tracker', 10, 5 );
- function tracker( $input, $field, $value, $lead_id, $form_id ) {
- // because this will fire for every form/field, only do it when it is the specific form and field
- if ( $form_id == 1 && $field->id == 1 ) {
- $input = '<ul class="gfield_radio" id="input_1_1"><li class="gchoice_1_1_0"><input name="input_1" type="radio" value="G образная форма" id="choice_1_1_0" tabindex="1"><label for="choice_1_1_0" id="label_1_1_0"><img src="http://canticucine.ru/wp-content/uploads/2018/04/1.png"> <div>G образная форма</div></label></li><li class="gchoice_1_1_1"><input name="input_1" type="radio" value="L образная форма" id="choice_1_1_1" tabindex="2"><label for="choice_1_1_1" id="label_1_1_1"><img src="http://canticucine.ru/wp-content/uploads/2018/04/2.png"> <div>L образная форма</div></label></li><li class="gchoice_1_1_2"><input name="input_1" type="radio" value="Линейная форма" id="choice_1_1_2" tabindex="3"><label for="choice_1_1_2" id="label_1_1_2"><img src="http://canticucine.ru/wp-content/uploads/2018/04/3.png"> <div>Линейная форма</div></label></li><div class="gravity_wrap_input"></div><li class="gchoice_1_1_3"><input name="input_1" type="radio" value="Форма островного типа" id="choice_1_1_3" tabindex="4"><label for="choice_1_1_3" id="label_1_1_3"><img src="http://canticucine.ru/wp-content/uploads/2018/04/4.png"> <div>Форма островного типа</div></label></li><li class="gchoice_1_1_4"><input name="input_1" type="radio" value="Параллельная форма" id="choice_1_1_4" tabindex="5"><label for="choice_1_1_4" id="label_1_1_4"><img src="http://canticucine.ru/wp-content/uploads/2018/04/5.png"> <div>Паралельная форма</div></label></li><li class="gchoice_1_1_5"><input name="input_1" type="radio" value="U образная форма" id="choice_1_1_5" tabindex="6"><label for="choice_1_1_5" id="label_1_1_5"><img src="http://canticucine.ru/wp-content/uploads/2018/04/6.png"> <div>U образная форма</div></label></li></ul><style>#input_1_1 label:not(:first-child) {
- position: relative;
- border-bottom: 1px solid #ccc;
- }
- #input_1_1 label > div {
- position: absolute;
- bottom: 20px;
- left: 0;
- right: 0;
- text-align: center;
- }
- #gform_fields_1 label > div {
- text-align: center;
- }
- #input_1_3 label,
- #input_1_4 label,
- #input_1_5 label {
- max-width: 172px;
- }
- #input_1_3 label {
- min-height: 279px;
- }
- #input_1_4 label {
- min-height: 258px;
- }
- #input_1_5 label {
- min-height: 216px;
- }
- #field_1_9,
- #field_1_10,
- #field_1_11,
- #field_1_12 {
- max-width: 259px;
- padding: 0 !important;
- }
- #field_1_9 input,
- #field_1_10 input,
- #field_1_12 input {
- width: 100%;
- }
- #field_1_4 {
- padding-top: 0 !important;
- }
- #gform_submit_button_1 {
- background-color: #373d4d;
- color: #fff;
- transition: opacity 0.3s ease;
- }
- #gform_submit_button_1:hover {
- opacity: 0.8;
- }
- #input_1_1 li,
- #input_1_2 li,
- #input_1_3 li,
- #input_1_4 li,
- #input_1_5 li
- {
- display: inline-block;
- margin-right: 40px;
- }
- @media only screen and (max-width: 1024px) {
- #input_1_1 .gravity_wrap_input,
- #input_1_2 .gravity_wrap_input,
- #input_1_3 .gravity_wrap_input,
- #input_1_4 .gravity_wrap_input,
- #input_1_5 .gravity_wrap_input {
- display: inline-block;
- }
- }
- @media only screen and (max-width: 760px) {
- #input_1_3 label {
- min-height: 279px;
- }
- #input_1_4 label {
- min-height: 258px;
- }
- #input_1_5 label {
- min-height: 216px;
- }
- #field_1_9,
- #field_1_10,
- #field_1_11 {
- max-width: 100%;
- }
- }
- .gform_wrapper .gfield_radio li label {
- max-width: 100%;
- }
- body .gform_wrapper ul li.gfield {
- padding-top: 40px;
- }
- </style>';
- }
- if ( $form_id == 1 && $field->id == 2 ) {
- $input = '<ul class="gfield_radio" id="input_1_2"><li class="gchoice_1_2_0"><input name="input_2" type="radio" value="Классический" id="choice_1_2_0" tabindex="1"><label for="choice_1_2_0" id="label_1_2_0"><img src="http://canticucine.ru/wp-content/uploads/2018/04/classic.jpg"> <div>Классический</div></label></li><li class="gchoice_1_2_1"><input name="input_2" type="radio" value="Арт Деко" id="choice_1_2_1" tabindex="2"><label for="choice_1_2_1" id="label_1_2_1"><img src="http://canticucine.ru/wp-content/uploads/2018/04/art-deco.jpg"> <div>Арт Деко</div></label></li><li class="gchoice_1_2_2"><input name="input_2" type="radio" value="Модерн" id="choice_1_2_2" tabindex="3"><label for="choice_1_2_2" id="label_1_2_2"><img src="http://canticucine.ru/wp-content/uploads/2018/04/modern.jpg"> <div>Модерн</div></label></li><li class="gchoice_1_2_3"><input name="input_2" type="radio" value="Современная классика" id="choice_1_2_3" tabindex="4"><label for="choice_1_2_3" id="label_1_2_3"><img src="http://canticucine.ru/wp-content/uploads/2018/04/sovr-classic.jpg"> <div>Современная классика</div></label></li><div class="gravity_wrap_input"></div><li class="gchoice_1_2_4"><input name="input_2" type="radio" value="Прованс" id="choice_1_2_4" tabindex="5"><label for="choice_1_2_4" id="label_1_2_4"><img src="http://canticucine.ru/wp-content/uploads/2018/04/provans.jpg"> <div>Прованс</div></label></li><li class="gchoice_1_2_5"><input name="input_2" type="radio" value="Винтаж" id="choice_1_2_5" tabindex="6"><label for="choice_1_2_5" id="label_1_2_5"><img src="http://canticucine.ru/wp-content/uploads/2018/04/vintage.jpg"> <div>Винтаж</div></label></li><li class="gchoice_1_2_6"><input name="input_2" type="radio" value="Урбан/Индастриал" id="choice_1_2_6" tabindex="7"><label for="choice_1_2_6" id="label_1_2_6"><img src="http://canticucine.ru/wp-content/uploads/2018/04/Urban.jpg"> <div>Урбан/Индастриал</div></label></li><li class="gchoice_1_2_7"><input name="input_2" type="radio" value="Еще не знаю" id="choice_1_2_7" tabindex="8"><label for="choice_1_2_7" id="label_1_2_7"><img src="http://canticucine.ru/wp-content/uploads/2018/04/none-1.jpg"> <div>Еще не знаю</div></label></li></ul>';
- }
- if ( $form_id == 1 && $field->id == 3 ) {
- $input = '<ul class="gfield_radio" id="input_1_3"><li class="gchoice_1_3_0"><input name="input_3" type="radio" value="Шпон дерева. Покрытие тонким слоем натурального дерева ценных пород." id="choice_1_3_0" tabindex="1"><label for="choice_1_3_0" id="label_1_3_0"><img src="http://canticucine.ru/wp-content/uploads/2018/04/1.jpg"> <div>Шпон дерева. Покрытие тонким слоем натурального дерева ценных пород.</div></label></li><li class="gchoice_1_3_1"><input name="input_3" type="radio" value="Массив дерева. Эксклюзивно и экологично" id="choice_1_3_1" tabindex="2"><label for="choice_1_3_1" id="label_1_3_1"><img src="http://canticucine.ru/wp-content/uploads/2018/04/2.jpg"> <div>Массив дерева. Эксклюзивно и экологично</div></label></li><li class="gchoice_1_3_2"><input name="input_3" type="radio" value="Шпон натурального камня." id="choice_1_3_2" tabindex="3"><label for="choice_1_3_2" id="label_1_3_2"><img src="http://canticucine.ru/wp-content/uploads/2018/04/3.jpg"> <div>Шпон натурального камня.</div></label></li><li class="gchoice_1_3_3"><input name="input_3" type="radio" value="Металлизированная краска." id="choice_1_3_3" tabindex="4"><label for="choice_1_3_3" id="label_1_3_3"><img src="http://canticucine.ru/wp-content/uploads/2018/04/4.jpg"> <div>Металлизированная краска.</div></label></li><div class="gravity_wrap_input"></div><li class="gchoice_1_3_4"><input name="input_3" type="radio" value="Нержавейка. Экологично, практично, брутально." id="choice_1_3_4" tabindex="5"><label for="choice_1_3_4" id="label_1_3_4"><img src="http://canticucine.ru/wp-content/uploads/2018/04/5.jpg"> <div>Нержавейка. Экологично, практично, брутально.</div></label></li><li class="gchoice_1_3_5"><input name="input_3" type="radio" value="Экошпон, акрилы, нано-пластики. Иновационные износостойкие материалы." id="choice_1_3_5" tabindex="6"><label for="choice_1_3_5" id="label_1_3_5"><img src="http://canticucine.ru/wp-content/uploads/2018/04/6.jpg"> <div>Экошпон, акрилы, нано-пластики. Иновационные износостойкие материалы.</div></label></li><li class="gchoice_1_3_6"><input name="input_3" type="radio" value="Мдф покрытое эмалью. Несколько слоёв краски +несколько слоёв лака-автомобильная технология." id="choice_1_3_6" tabindex="7"><label for="choice_1_3_6" id="label_1_3_6"><img src="http://canticucine.ru/wp-content/uploads/2018/04/7.jpg"> <div>Мдф покрытое эмалью. Несколько слоёв краски +несколько слоёв лака-автомобильная технология.</div></label></li><li class="gchoice_1_3_7"><input name="input_3" type="radio" value="Мдф в пленке. Демократичная цена. Различный дизайн." id="choice_1_3_7" tabindex="8"><label for="choice_1_3_7" id="label_1_3_7"><img src="http://canticucine.ru/wp-content/uploads/2018/04/8.jpg"> <div>Мдф в пленке. Демократичная цена. Различный дизайн.</div></label></li><div class="gravity_wrap_input"></div><li class="gchoice_1_3_8"><input name="input_3" type="radio" value="Еще не знаю" id="choice_1_3_8" tabindex="9"><label for="choice_1_3_8" id="label_1_3_8"><img src="http://canticucine.ru/wp-content/uploads/2018/04/none-1.jpg"> <div>Еще не знаю</div></label></li></ul>';
- }
- if ( $form_id == 1 && $field->id == 4 ) {
- $input = '<ul class="gfield_radio" id="input_1_4"><li class="gchoice_1_4_0"><input name="input_4" type="radio" value="ДСП пластик - влагостойкая, огромный выбор, самое популярное" id="choice_1_4_0" tabindex="1"><label for="choice_1_4_0" id="label_1_4_0"><img src="http://canticucine.ru/wp-content/uploads/2018/04/1-1.jpg"> <div>ДСП пластик - влагостойкая, огромный выбор, самое популярное</div></label></li><li class="gchoice_1_4_1"><input name="input_4" type="radio" value="Дерево с пропиткой - требовательно к обслуживанию" id="choice_1_4_1" tabindex="2"><label for="choice_1_4_1" id="label_1_4_1"><img src="http://canticucine.ru/wp-content/uploads/2018/04/2-1.jpg"> <div>Дерево с пропиткой - требовательно к обслуживанию</div></label></li><li class="gchoice_1_4_2"><input name="input_4" type="radio" value="Искусственный камень (средняя стоимость и дорого) - долговечно и огромный выбор цветов" id="choice_1_4_2" tabindex="3"><label for="choice_1_4_2" id="label_1_4_2"><img src="http://canticucine.ru/wp-content/uploads/2018/04/3-1.jpg"> <div>Искусственный камень (средняя стоимость и дорого) - долговечно и огромный выбор цветов</div></label></li><div class="gravity_wrap_input"></div><li class="gchoice_1_4_3"><input name="input_4" type="radio" value="Кварцит. Наиболее прочный и долговечный. На наш взгляд лучший материал для столешниц" id="choice_1_4_3" tabindex="4"><label for="choice_1_4_3" id="label_1_4_3"><img src="http://canticucine.ru/wp-content/uploads/2018/04/9.jpg"> <div>Кварцит. Наиболее прочный и долговечный. На наш взгляд лучший материал для столешниц</div></label></li><li class="gchoice_1_4_4"><input name="input_4" type="radio" value="Нержавейка" id="choice_1_4_4" tabindex="5"><label for="choice_1_4_4" id="label_1_4_4"><img src="http://canticucine.ru/wp-content/uploads/2018/04/5-1.jpg"> <div>Нержавейка</div></label></li><li class="gchoice_1_4_5"><input name="input_4" type="radio" value="Еще не знаю" id="choice_1_4_5" tabindex="6"><label for="choice_1_4_5" id="label_1_4_5"><img src="http://canticucine.ru/wp-content/uploads/2018/04/none-1.jpg"> <div>Еще не знаю</div></label></li></ul>';
- }
- if ( $form_id == 1 && $field->id == 5 ) {
- $input = '<ul class="gfield_radio" id="input_1_5"><li class="gchoice_1_5_0"><input name="input_5" type="radio" value="Без панели" id="choice_1_5_0" tabindex="1"><label for="choice_1_5_0" id="label_1_5_0"><img src="http://canticucine.ru/wp-content/uploads/2018/04/1-2.jpg"> <div>Без панели</div></label></li><li class="gchoice_1_5_1"><input name="input_5" type="radio" value="Фотопечать" id="choice_1_5_1" tabindex="2"><label for="choice_1_5_1" id="label_1_5_1"><img src="http://canticucine.ru/wp-content/uploads/2018/04/2-2.jpg"> <div>Фотопечать</div></label></li><li class="gchoice_1_5_2"><input name="input_5" type="radio" value="Из материала столещницы" id="choice_1_5_2" tabindex="3"><label for="choice_1_5_2" id="label_1_5_2"><img src="http://canticucine.ru/wp-content/uploads/2018/04/3-2.jpg"> <div>Из материала столещницы</div></label></li><li class="gchoice_1_5_3"><input name="input_5" type="radio" value="Еще не знаю" id="choice_1_5_3" tabindex="4"><label for="choice_1_5_3" id="label_1_5_3"><img src="http://canticucine.ru/wp-content/uploads/2018/04/none-1.jpg"> <div>Еще не знаю</div></label></li></ul>';
- }
- return $input;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement