PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / views / frm-fields / front-end / product-select.php

product-select.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More trunk, at classes/views/frm-fields/front-end/product-select.php

44 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Show the product field as dropdown on the front-end.
4 * Extra line breaks show as space on the front-end when
5 * the form is double filtered and not minimized.
6 *
7 * @since 6.30 This is copied from the Formidable Pro plugin.
8 *
9 * @package Formidable
10 *
11 * @var bool $hide_label
12 */
13
14 if ( ! defined( 'ABSPATH' ) ) {
15 die( 'You are not allowed to call this page directly.' );
16 }
17 ?>
18 <select name="<?php echo esc_attr( $field_name ); ?>" id="<?php echo esc_attr( $html_id ); ?>" <?php do_action( 'frm_field_input_html', $field ); ?>>
19 <?php
20 $placeholder = FrmFieldsController::add_placeholder_to_select( $field );
21 $skipped = false;
22
23 foreach ( $field['options'] as $opt_key => $opt ) {
24 $field_val = FrmFieldsHelper::get_value_from_array( $opt, $opt_key, $field );
25 $selected = FrmAppHelper::check_selected( $field['value'], $field_val );
26 $price = FrmFieldProduct::get_price_from_array( $opt, $opt_key, $field );
27 $opt = FrmFieldsHelper::get_label_from_array( $opt, $opt_key, $field );
28
29 if ( $placeholder && '' === $opt && ! $skipped ) {
30 $skipped = true;
31 continue;
32 }
33 FrmHtmlHelper::echo_dropdown_option(
34 $opt,
35 $selected,
36 array(
37 'value' => $field_val,
38 'data-frmprice' => $price,
39 )
40 );
41 }
42 ?>
43 </select>
44