PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.5
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.5
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/FrmFormsHelper.php +23 -83 6.45.5 View file →
@@ -96,17 +96,8 @@
96 96 $args['frm_action'] = 'list';
97 97 $args['form'] = 0;
98 98 } elseif ( FrmAppHelper::is_admin_page( 'formidable' ) && in_array( $frm_action, array( 'new', 'duplicate' ) ) ) {
99 99 $args['frm_action'] = 'edit';
100 - } elseif ( FrmAppHelper::is_style_editor_page() ) {
101 - unset( $args['id'] ); // Avoid passing style into form switcher on style page.
102 - $query_args = array(
103 - 'page' => 'formidable-styles',
104 - );
105 - if ( $frm_action ) {
106 - $query_args['frm_action'] = $frm_action;
107 - }
108 - $base = add_query_arg( $query_args, admin_url( 'admin.php' ) );
109 100 } elseif ( isset( $_GET['post'] ) ) {
110 101 $args['form'] = 0;
111 102 $base = admin_url( 'edit.php?post_type=frm_display' );
112 103 }
@@ -133,15 +124,15 @@
133 124 <?php
134 125 return;
135 126 }
136 127 ?>
137 - <div id="frm_bs_dropdown" class="dropdown <?php echo esc_attr( is_rtl() ? 'dropdown-menu-right' : 'dropdown-menu-left' ); ?>">
128 + <div id="frm_bs_dropdown" class="dropdown <?php echo esc_attr( is_rtl() ? 'pull-right' : 'pull-left' ); ?>">
138 129 <a href="#" id="frm-navbarDrop" class="frm-dropdown-toggle" data-toggle="dropdown">
139 130 <h1>
140 131 <span class="frm_bstooltip" title="<?php echo esc_attr( $truncated_name === $name ? '' : $name ); ?>" data-placement="right">
141 132 <?php echo esc_html( $name ); ?>
142 133 </span>
143 - <?php FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown6_icon', array( 'aria-hidden' => 'true' ) ); ?>
134 + <?php FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown4_icon', array( 'aria-hidden' => 'true' ) ); ?>
144 135 </h1>
145 136 </a>
146 137 <ul class="frm-dropdown-menu frm-on-top frm-inline-modal frm_code_list frm-full-hover" role="menu" aria-labelledby="frm-navbarDrop">
147 138 <?php if ( count( $forms ) > 8 ) { ?>
@@ -174,11 +165,10 @@
174 165 $url = isset( $base ) ? add_query_arg( $args, $base ) : add_query_arg( $args );
175 166 $form_name = empty( $form->name ) ? __( '(no title)', 'formidable' ) : $form->name;
176 167 ?>
177 168 <li class="frm-dropdown-form">
178 - <a href="<?php echo esc_url( $url ); ?>" tabindex="-1" class="frm-justify-between">
179 - <?php echo esc_html( $form_name ); ?>
180 - <span>
169 + <a href="<?php echo esc_url( $url ); ?>" tabindex="-1">
170 + <span class="frm-sub-label">
181 171 <?php
182 172 printf(
183 173 /* translators: %d: Form ID */
184 174 esc_html__( '(ID %d)', 'formidable' ),
@@ -185,8 +175,9 @@
185 175 esc_attr( $form->id )
186 176 );
187 177 ?>
188 178 </span>
179 + <?php echo esc_html( $form_name ); ?>
189 180 <span class="frm_hidden"><?php echo esc_html( $form->form_key ); ?></span>
190 181 </a>
191 182 </li>
192 183 <?php
@@ -396,9 +387,8 @@
396 387 'after_html' => '',
397 388 'submit_html' => self::get_default_html( 'submit' ),
398 389 'show_title' => 0,
399 390 'show_description' => 0,
400 - 'ajax_submit' => 0,
401 391 );
402 392 }
403 393
404 394 /**
@@ -604,19 +594,19 @@
604 594 ?>
605 595 <li class="<?php echo esc_attr( $class ); ?>">
606 596 <a href="javascript:void(0)" class="frmids frm_insert_code"
607 597 data-code="<?php echo esc_attr( $args['id'] ); ?>">
598 + <span>[<?php echo esc_attr( isset( $args['id_label'] ) ? $args['id_label'] : $args['id'] ); ?>]</span>
608 599 <?php FrmAppHelper::icon_by_class( $field['icon'], array( 'aria-hidden' => 'true' ) ); ?>
609 600 <?php echo esc_attr( FrmAppHelper::truncate( $args['name'], 60 ) ); ?>
610 - <span>[<?php echo esc_attr( isset( $args['id_label'] ) ? $args['id_label'] : $args['id'] ); ?>]</span>
611 601 </a>
612 602 <a href="javascript:void(0)" class="frmkeys frm_insert_code frm_hidden"
613 603 data-code="<?php echo esc_attr( $args['key'] ); ?>">
604 + <span>[<?php echo esc_attr( FrmAppHelper::truncate( isset( $args['key_label'] ) ? $args['key_label'] : $args['key'], 7 ) ); ?>]</span>
614 605 <?php if ( isset( $field['icon'] ) ) { ?>
615 606 <?php FrmAppHelper::icon_by_class( $field['icon'], array( 'aria-hidden' => 'true' ) ); ?>
616 607 <?php } ?>
617 608 <?php echo esc_attr( FrmAppHelper::truncate( $args['name'], 60 ) ); ?>
618 - <span>[<?php echo esc_attr( FrmAppHelper::truncate( isset( $args['key_label'] ) ? $args['key_label'] : $args['key'], 7 ) ); ?>]</span>
619 609 </a>
620 610 </li>
621 611 <?php
622 612 }
@@ -640,12 +630,12 @@
640 630 <li class="<?php echo esc_attr( $args['class'] ); ?>">
641 631 <a href="javascript:void(0)" class="frm_insert_code <?php echo $has_tooltip ? 'frm_help' : ''; ?>"
642 632 <?php echo $has_tooltip ? 'title="' . esc_attr( $args['title'] ) . '"' : ''; ?>
643 633 data-code="<?php echo esc_attr( $args['code'] ); ?>">
644 - <?php echo esc_attr( FrmAppHelper::truncate( $args['label'], 60 ) ); ?>
645 634 <span>
646 635 [<?php echo esc_attr( FrmAppHelper::truncate( $args['code'], 10 ) ); ?>]
647 636 </span>
637 + <?php echo esc_attr( FrmAppHelper::truncate( $args['label'], 60 ) ); ?>
648 638 </a>
649 639 </li>
650 640 <?php
651 641 }
@@ -1198,12 +1188,9 @@
1198 1188 'label' => __( 'Move Form to Trash', 'formidable' ),
1199 1189 'short' => __( 'Trash', 'formidable' ),
1200 1190 'url' => wp_nonce_url( $base_url . '&frm_action=trash', 'trash_form_' . absint( $id ) ),
1201 1191 'icon' => 'frm_icon_font frm_delete_icon',
1202 - 'data' => array(
1203 - 'frmverify' => __( 'Do you want to move this form to the trash?', 'formidable' ),
1204 - 'frmverify-btn' => 'frm-button-red',
1205 - ),
1192 + 'data' => array( 'frmverify' => __( 'Do you want to move this form to the trash?', 'formidable' ) ),
1206 1193 ),
1207 1194 'delete' => array(
1208 1195 'label' => __( 'Delete Permanently', 'formidable' ),
1209 1196 'short' => __( 'Delete', 'formidable' ),
@@ -1209,12 +1196,9 @@
1209 1196 'short' => __( 'Delete', 'formidable' ),
1210 1197 'url' => wp_nonce_url( $base_url . '&frm_action=destroy', 'destroy_form_' . absint( $id ) ),
1211 1198 'confirm' => __( 'Are you sure you want to delete this form and all its entries?', 'formidable' ),
1212 1199 'icon' => 'frm_icon_font frm_delete_icon',
1213 - 'data' => array(
1214 - 'frmverify' => __( 'This will permanently delete the form and all its entries. This is irreversible. Are you sure you want to continue?', 'formidable' ),
1215 - 'frmverify-btn' => 'frm-button-red',
1216 - ),
1200 + 'data' => array( 'frmverify' => __( 'This will permanently delete the form and all its entries. This is irreversible. Are you sure you want to continue?', 'formidable' ) ),
1217 1201 ),
1218 1202 );
1219 1203 }
1220 1204
@@ -1300,24 +1284,9 @@
1300 1284
1301 1285 return $name;
1302 1286 }
1303 1287
1304 - /**
1305 - * @param array $categories
1306 - * @param array $atts {
1307 - * @type string $html 'span' or 'div'.
1308 - * @type boolean $bg Whether to add a bg color or not.
1309 - * }
1310 - *
1311 - * @return void
1312 - */
1313 - public static function template_icon( $categories, $atts = array() ) {
1314 - $defaults = array(
1315 - 'html' => 'span',
1316 - 'bg' => false,
1317 - );
1318 - $atts = array_merge( $defaults, $atts );
1319 -
1288 + public static function template_icon( $categories ) {
1320 1289 $ignore = self::ignore_template_categories();
1321 1290 $categories = array_diff( $categories, $ignore );
1322 1291
1323 1292 $icons = array(
@@ -1323,32 +1292,26 @@
1323 1292 $icons = array(
1324 1293 'WooCommerce' => array( 'woocommerce', 'var(--purple)' ),
1325 1294 'Post' => array( 'wordpress', 'rgb(0,160,210)' ),
1326 1295 'User Registration' => array( 'register', 'var(--pink)' ),
1327 - 'Registration and Signup' => array( 'register', 'var(--pink)' ),
1328 1296 'PayPal' => array( 'paypal' ),
1329 1297 'Stripe' => array( 'credit_card', 'var(--green)' ),
1330 - 'Twilio' => array( 'sms' ),
1331 - 'Payment' => array( 'credit_card' ),
1332 - 'Order Form' => array( 'product' ),
1333 - 'Finance' => array( 'total' ),
1298 + 'Twilio' => array( 'sms', 'rgb(0,160,210)' ),
1299 + 'Payment' => array( 'credit_card', 'var(--green)' ),
1334 1300 'Health and Wellness' => array( 'heart', 'var(--pink)' ),
1335 1301 'Event Planning' => array( 'calendar', 'var(--orange)' ),
1336 - 'Real Estate' => array( 'house' ),
1337 - 'Nonprofit' => array( 'heart_solid' ),
1302 + 'Real Estate' => array( 'house', 'var(--purple)' ),
1338 1303 'Calculator' => array( 'calculator', 'var(--purple)' ),
1339 - 'Quiz' => array( 'percent' ),
1340 1304 'Registrations' => array( 'address_card' ),
1341 - 'Customer Service' => array( 'users_solid' ),
1342 - 'Education' => array( 'pencil' ),
1343 - 'Marketing' => array( 'eye' ),
1344 - 'Feedback' => array( 'smile' ),
1305 + 'Customer Service' => array( 'users_solid', 'var(--pink)' ),
1306 + 'Education' => array( 'pencil', 'var(--primary-color)' ),
1307 + 'Marketing' => array( 'eye', 'rgb(0,160,210)' ),
1308 + 'Feedback' => array( 'smile', 'var(--green)' ),
1345 1309 'Business Operations' => array( 'case' ),
1346 1310 'Contact Form' => array( 'email' ),
1347 - 'Conversational Forms' => array( 'chat_forms' ),
1348 - 'Survey' => array( 'chat_forms', 'var(--orange)' ),
1349 - 'Application' => array( 'align_right' ),
1350 - 'Signature' => array( 'signature' ),
1311 + 'Survey' => array( 'comment', 'var(--primary-color)' ),
1312 + 'Application Form' => array( 'align_right', 'rgb(0,160,210)' ),
1313 + 'Quiz' => array( 'percent' ),
1351 1314 '' => array( 'align_right' ),
1352 1315 );
1353 1316
1354 1317 $icons[ __( 'My Templates', 'formidable' ) ] = array( 'user', 'var(--orange)' );
@@ -1366,29 +1329,18 @@
1366 1329 }
1367 1330 $icon = reset( $icons );
1368 1331 }
1369 1332
1370 - $bg = isset( $icon[1] ) ? $icon[1] : '';
1371 -
1372 - if ( $atts['html'] === 'div' ) {
1373 - echo '<div class="frm-category-icon frm-icon-wrapper" role="button"';
1374 - } else {
1375 - echo '<span class="frm-inner-circle"';
1376 - }
1377 - echo empty( $bg ) || empty( $atts['bg'] ) ? '' : ' style="background-color:' . esc_attr( $bg ) . '"';
1378 - echo '>';
1379 -
1333 + echo '<span class="frm-inner-circle" ' . ( isset( $icon[1] ) ? 'style="background-color:' . esc_attr( $icon[1] ) : '' ) . '">';
1380 1334 FrmAppHelper::icon_by_class( 'frmfont frm_' . $icon[0] . '_icon' );
1381 1335 echo '<span class="frm_hidden">';
1382 1336 FrmAppHelper::icon_by_class( 'frmfont frm_lock_icon' );
1383 1337 echo '</span>';
1384 - echo '</' . esc_attr( $atts['html'] ) . '>';
1338 + echo '</span>';
1385 1339 }
1386 1340
1387 1341 /**
1388 1342 * @since 4.03.01
1389 - *
1390 - * @return array<string>
1391 1343 */
1392 1344 public static function ignore_template_categories() {
1393 1345 return array( 'Business', 'Elite', 'Personal', 'Creator', 'Basic', 'free' );
1394 1346 }
@@ -1754,18 +1706,6 @@
1754 1706 return $url;
1755 1707 }
1756 1708
1757 1709 return str_replace( $original_query, $query, $url );
1758 - }
1759 -
1760 - /**
1761 - * Check if Pro isn't up to date yet.
1762 - * If Pro is active but using a version earlier than v6.2 fallback to Pro for AJAX submit (so things don't all happen twice).
1763 - *
1764 - * @since 6.2
1765 - *
1766 - * @return bool
1767 - */
1768 - public static function should_use_pro_for_ajax_submit() {
1769 - return is_callable( 'FrmProForm::is_ajax_on' ) && ! is_callable( 'FrmProFormsHelper::lite_supports_ajax_submit' );
1770 1710 }
1771 1711 }