PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.18
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.18
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/controllers/FrmEntriesController.php +13 -20 6.256.18 View file →
@@ -99,9 +99,9 @@
99 99 add_filter( 'manage_' . $base . '_columns', 'FrmEntriesController::manage_columns' );
100 100 add_filter( 'get_user_option_' . self::hidden_column_key( $menu_name ), 'FrmEntriesController::hidden_columns' );
101 101 add_filter( 'manage_' . $base . '_sortable_columns', 'FrmEntriesController::sortable_columns' );
102 102 } else {
103 - add_filter( 'screen_options_show_screen', self::class . '::remove_screen_options', 10, 2 );
103 + add_filter( 'screen_options_show_screen', __CLASS__ . '::remove_screen_options', 10, 2 );
104 104 }
105 105 }
106 106
107 107 /**
@@ -392,10 +392,8 @@
392 392 * @param mixed $result Option value from database for hidden columns in entries table.
393 393 * @return array
394 394 */
395 395 public static function hidden_columns( $result ) {
396 - global $frm_vars;
397 -
398 396 if ( ! is_array( $result ) ) {
399 397 // Force an unexpected value to be an array.
400 398 // Since $result is a filtered option and gets saved to the database, it's possible it could be a string.
401 399 // Since this code expects an array it would break with a "Uncaught Error: [] operator not supported for strings" error.
@@ -401,16 +399,21 @@
401 399 // Since this code expects an array it would break with a "Uncaught Error: [] operator not supported for strings" error.
402 400 $result = array();
403 401 }
404 402
405 - $form_id = FrmForm::get_current_form_id();
406 - $hidden = self::user_hidden_columns_for_form( $form_id, $result );
407 - $i = isset( $frm_vars['cols'] ) ? count( $frm_vars['cols'] ) : 0;
408 - $max_columns = 11;
403 + $form_id = FrmForm::get_current_form_id();
409 404
405 + $hidden = self::user_hidden_columns_for_form( $form_id, $result );
406 +
407 + global $frm_vars;
408 + $i = isset( $frm_vars['cols'] ) ? count( $frm_vars['cols'] ) : 0;
409 +
410 410 if ( ! empty( $hidden ) ) {
411 - $result = $hidden;
412 - $i = $i - count( $result );
411 + $result = $hidden;
412 + $i = $i - count( $result );
413 + $max_columns = 11;
414 + } else {
415 + $max_columns = 8;
413 416 }
414 417
415 418 if ( $i <= $max_columns ) {
416 419 return $result;
@@ -444,12 +447,8 @@
444 447 /**
445 448 * Remove some columns by default when there are too many
446 449 *
447 450 * @since 2.05.07
448 - *
449 - * @param array $atts
450 - * @param array $result
451 - * @return void
452 451 */
453 452 private static function remove_excess_cols( $atts, &$result ) {
454 453 global $frm_vars;
455 454
@@ -516,9 +515,9 @@
516 515
517 516 private static function get_delete_form_time( $form, &$errors ) {
518 517 if ( 'trash' === $form->status ) {
519 518 $delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS );
520 - $time_to_delete = FrmAppHelper::human_time_diff( $delete_timestamp, ( $form->options['trash_time'] ?? time() ) );
519 + $time_to_delete = FrmAppHelper::human_time_diff( $delete_timestamp, ( isset( $form->options['trash_time'] ) ? $form->options['trash_time'] : time() ) );
521 520
522 521 /* translators: %1$s: Time string */
523 522 $errors['trash'] = sprintf( __( 'This form is in the trash and is scheduled to be deleted permanently in %s along with any entries.', 'formidable' ), $time_to_delete );
524 523 }
@@ -605,13 +604,8 @@
605 604 if ( ! $form ) {
606 605 return;
607 606 }
608 607
609 - $is_preview = 'frm_forms_preview' === FrmAppHelper::simple_get( 'action' );
610 - if ( $is_preview && FrmFormsHelper::should_block_preview( $form->form_key ) ) {
611 - return;
612 - }
613 -
614 608 $params = FrmForm::get_params( $form );
615 609
616 610 if ( ! isset( $frm_vars['form_params'] ) ) {
617 611 $frm_vars['form_params'] = array();
@@ -734,9 +728,8 @@
734 728 'exclude_fields' => '',
735 729 'include_fields' => '',
736 730 'include_extras' => '',
737 731 'inline_style' => 1,
738 - 'table_style' => '',
739 732 // Return embedded fields as nested array.
740 733 'child_array' => false,
741 734 'line_breaks' => true,
742 735 'array_separator' => ', ',