| @@ -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,11 +399,15 @@ | ||
| 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; | |
| 403 | + $form_id = FrmForm::get_current_form_id(); | |
| 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 | + | |
| 408 | 410 | $max_columns = 11; |
| 409 | 411 | |
| 410 | 412 | if ( ! empty( $hidden ) ) { |
| 411 | 413 | $result = $hidden; |
| @@ -444,12 +446,8 @@ | ||
| 444 | 446 | /** |
| 445 | 447 | * Remove some columns by default when there are too many |
| 446 | 448 | * |
| 447 | 449 | * @since 2.05.07 |
| 448 | - * | |
| 449 | - * @param array $atts | |
| 450 | - * @param array $result | |
| 451 | - * @return void | |
| 452 | 450 | */ |
| 453 | 451 | private static function remove_excess_cols( $atts, &$result ) { |
| 454 | 452 | global $frm_vars; |
| 455 | 453 | |
| @@ -516,9 +514,9 @@ | ||
| 516 | 514 | |
| 517 | 515 | private static function get_delete_form_time( $form, &$errors ) { |
| 518 | 516 | if ( 'trash' === $form->status ) { |
| 519 | 517 | $delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS ); |
| 520 | - $time_to_delete = FrmAppHelper::human_time_diff( $delete_timestamp, ( $form->options['trash_time'] ?? time() ) ); | |
| 518 | + $time_to_delete = FrmAppHelper::human_time_diff( $delete_timestamp, ( isset( $form->options['trash_time'] ) ? $form->options['trash_time'] : time() ) ); | |
| 521 | 519 | |
| 522 | 520 | /* translators: %1$s: Time string */ |
| 523 | 521 | $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 | 522 | } |
| @@ -734,9 +732,8 @@ | ||
| 734 | 732 | 'exclude_fields' => '', |
| 735 | 733 | 'include_fields' => '', |
| 736 | 734 | 'include_extras' => '', |
| 737 | 735 | 'inline_style' => 1, |
| 738 | - 'table_style' => '', | |
| 739 | 736 | // Return embedded fields as nested array. |
| 740 | 737 | 'child_array' => false, |
| 741 | 738 | 'line_breaks' => true, |
| 742 | 739 | 'array_separator' => ', ', |