| @@ -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 | /** |
| @@ -132,12 +132,10 @@ | ||
| 132 | 132 | * |
| 133 | 133 | * @since 3.0 |
| 134 | 134 | */ |
| 135 | 135 | public static function remove_screen_options( $show_screen, $screen ) { |
| 136 | - $menu_name = sanitize_title( FrmAppHelper::get_menu_name() ); | |
| 137 | - $unread_count = FrmEntriesHelper::get_visible_unread_inbox_count(); | |
| 138 | - | |
| 139 | - if ( $screen->id === $menu_name . ( $unread_count ? '-' . $unread_count : '' ) . '_page_formidable-entries' ) { | |
| 136 | + $menu_name = sanitize_title( FrmAppHelper::get_menu_name() ); | |
| 137 | + if ( $screen->id == $menu_name . '_page_formidable-entries' ) { | |
| 140 | 138 | $show_screen = false; |
| 141 | 139 | } |
| 142 | 140 | |
| 143 | 141 | return $show_screen; |
| @@ -334,11 +332,9 @@ | ||
| 334 | 332 | if ( empty( $menu_name ) ) { |
| 335 | 333 | $menu_name = FrmAppHelper::get_menu_name(); |
| 336 | 334 | } |
| 337 | 335 | |
| 338 | - $unread_count = FrmEntriesHelper::get_visible_unread_inbox_count(); | |
| 339 | - | |
| 340 | - return sanitize_title( $menu_name ) . ( $unread_count ? '-' . $unread_count : '' ) . '_page_formidable-entries'; | |
| 336 | + return sanitize_title( $menu_name ) . '_page_formidable-entries'; | |
| 341 | 337 | } |
| 342 | 338 | |
| 343 | 339 | public static function save_per_page( $save, $option, $value ) { |
| 344 | 340 | if ( $option === 'formidable_page_formidable_entries_per_page' ) { |
| @@ -392,10 +388,8 @@ | ||
| 392 | 388 | * @param mixed $result Option value from database for hidden columns in entries table. |
| 393 | 389 | * @return array |
| 394 | 390 | */ |
| 395 | 391 | public static function hidden_columns( $result ) { |
| 396 | - global $frm_vars; | |
| 397 | - | |
| 398 | 392 | if ( ! is_array( $result ) ) { |
| 399 | 393 | // Force an unexpected value to be an array. |
| 400 | 394 | // Since $result is a filtered option and gets saved to the database, it's possible it could be a string. |
| 401 | 395 | // Since this code expects an array it would break with a "Uncaught Error: [] operator not supported for strings" error. |
| @@ -401,16 +395,21 @@ | ||
| 401 | 395 | // Since this code expects an array it would break with a "Uncaught Error: [] operator not supported for strings" error. |
| 402 | 396 | $result = array(); |
| 403 | 397 | } |
| 404 | 398 | |
| 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; | |
| 399 | + $form_id = FrmForm::get_current_form_id(); | |
| 409 | 400 | |
| 401 | + $hidden = self::user_hidden_columns_for_form( $form_id, $result ); | |
| 402 | + | |
| 403 | + global $frm_vars; | |
| 404 | + $i = isset( $frm_vars['cols'] ) ? count( $frm_vars['cols'] ) : 0; | |
| 405 | + | |
| 410 | 406 | if ( ! empty( $hidden ) ) { |
| 411 | - $result = $hidden; | |
| 412 | - $i = $i - count( $result ); | |
| 407 | + $result = $hidden; | |
| 408 | + $i = $i - count( $result ); | |
| 409 | + $max_columns = 11; | |
| 410 | + } else { | |
| 411 | + $max_columns = 8; | |
| 413 | 412 | } |
| 414 | 413 | |
| 415 | 414 | if ( $i <= $max_columns ) { |
| 416 | 415 | return $result; |
| @@ -444,12 +443,8 @@ | ||
| 444 | 443 | /** |
| 445 | 444 | * Remove some columns by default when there are too many |
| 446 | 445 | * |
| 447 | 446 | * @since 2.05.07 |
| 448 | - * | |
| 449 | - * @param array $atts | |
| 450 | - * @param array $result | |
| 451 | - * @return void | |
| 452 | 447 | */ |
| 453 | 448 | private static function remove_excess_cols( $atts, &$result ) { |
| 454 | 449 | global $frm_vars; |
| 455 | 450 | |
| @@ -516,9 +511,9 @@ | ||
| 516 | 511 | |
| 517 | 512 | private static function get_delete_form_time( $form, &$errors ) { |
| 518 | 513 | if ( 'trash' === $form->status ) { |
| 519 | 514 | $delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS ); |
| 520 | - $time_to_delete = FrmAppHelper::human_time_diff( $delete_timestamp, ( $form->options['trash_time'] ?? time() ) ); | |
| 515 | + $time_to_delete = FrmAppHelper::human_time_diff( $delete_timestamp, ( isset( $form->options['trash_time'] ) ? $form->options['trash_time'] : time() ) ); | |
| 521 | 516 | |
| 522 | 517 | /* translators: %1$s: Time string */ |
| 523 | 518 | $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 | 519 | } |
| @@ -605,13 +600,8 @@ | ||
| 605 | 600 | if ( ! $form ) { |
| 606 | 601 | return; |
| 607 | 602 | } |
| 608 | 603 | |
| 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 | 604 | $params = FrmForm::get_params( $form ); |
| 615 | 605 | |
| 616 | 606 | if ( ! isset( $frm_vars['form_params'] ) ) { |
| 617 | 607 | $frm_vars['form_params'] = array(); |
| @@ -734,9 +724,8 @@ | ||
| 734 | 724 | 'exclude_fields' => '', |
| 735 | 725 | 'include_fields' => '', |
| 736 | 726 | 'include_extras' => '', |
| 737 | 727 | 'inline_style' => 1, |
| 738 | - 'table_style' => '', | |
| 739 | 728 | // Return embedded fields as nested array. |
| 740 | 729 | 'child_array' => false, |
| 741 | 730 | 'line_breaks' => true, |
| 742 | 731 | 'array_separator' => ', ', |