PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.7
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.7
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
← All changes | classes/helpers/FrmHtmlHelper.php +21 -0 6.36.7 View file →
@@ -31,5 +31,26 @@
31 31 },
32 32 isset( $args['echo'] ) ? $args['echo'] : false
33 33 );
34 34 }
35 +
36 + /**
37 + * Echo a dropdown option.
38 + * This is useful to avoid closing and opening PHP to echo <option> tags which leads to extra whitespace.
39 + * Avoiding whitespace saves 5KB of HTML for an international address field with a country dropdown with 252 options.
40 + *
41 + * @since 6.3.1
42 + *
43 + * @param string $option The string used as the option label.
44 + * @param bool $selected True if the option should be selected.
45 + * @param array $params Other HTML params for the option.
46 + * @return void
47 + */
48 + public static function echo_dropdown_option( $option, $selected, $params = array() ) {
49 + echo '<option ';
50 + FrmAppHelper::array_to_html_params( $params, true );
51 + selected( $selected );
52 + echo '>';
53 + echo esc_html( $option === '' ? ' ' : $option );
54 + echo '</option>';
55 + }
35 56 }