@@ -113,19 +113,19 @@ discard block |
||
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | foreach ( $action_controls as $action ) { |
| 116 | - if ( isset( $groups[ $action->id_base ] ) || in_array( $action->id_base, $grouped ) ) { |
|
| 116 | + if ( isset( $groups[$action->id_base] ) || in_array( $action->id_base, $grouped ) ) { |
|
| 117 | 117 | continue; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | $this_group = $action->action_options['group']; |
| 121 | - if ( ! isset( $groups[ $this_group ] ) ) { |
|
| 121 | + if ( ! isset( $groups[$this_group] ) ) { |
|
| 122 | 122 | $this_group = 'misc'; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - if ( ! isset( $groups[ $this_group ]['actions'] ) ) { |
|
| 126 | - $groups[ $this_group ]['actions'] = array(); |
|
| 125 | + if ( ! isset( $groups[$this_group]['actions'] ) ) { |
|
| 126 | + $groups[$this_group]['actions'] = array(); |
|
| 127 | 127 | } |
| 128 | - $groups[ $this_group ]['actions'][] = $action->id_base; |
|
| 128 | + $groups[$this_group]['actions'][] = $action->id_base; |
|
| 129 | 129 | |
| 130 | 130 | unset( $action ); |
| 131 | 131 | } |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | return $a; |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | - $actions[ $a->id_base ] = $a; |
|
| 282 | + $actions[$a->id_base] = $a; |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | return $actions; |
@@ -313,18 +313,18 @@ discard block |
||
| 313 | 313 | $action_map = array(); |
| 314 | 314 | |
| 315 | 315 | foreach ( $action_controls as $key => $control ) { |
| 316 | - $action_map[ $control->id_base ] = $key; |
|
| 316 | + $action_map[$control->id_base] = $key; |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | self::maybe_show_limit_warning( $form->id, $form_actions ); |
| 320 | 320 | |
| 321 | 321 | foreach ( $form_actions as $action ) { |
| 322 | - if ( ! isset( $action_map[ $action->post_excerpt ] ) ) { |
|
| 322 | + if ( ! isset( $action_map[$action->post_excerpt] ) ) { |
|
| 323 | 323 | // don't try and show settings if action no longer exists |
| 324 | 324 | continue; |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | - self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values ); |
|
| 327 | + self::action_control( $action, $form, $action->ID, $action_controls[$action_map[$action->post_excerpt]], $values ); |
|
| 328 | 328 | } |
| 329 | 329 | } |
| 330 | 330 | |
@@ -592,8 +592,8 @@ discard block |
||
| 592 | 592 | } |
| 593 | 593 | |
| 594 | 594 | // Store actions so they can be triggered with the correct priority. |
| 595 | - $stored_actions[ $action->ID ] = $action; |
|
| 596 | - $action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority']; |
|
| 595 | + $stored_actions[$action->ID] = $action; |
|
| 596 | + $action_priority[$action->ID] = $link_settings[$action->post_excerpt]->action_options['priority']; |
|
| 597 | 597 | |
| 598 | 598 | unset( $action ); |
| 599 | 599 | }//end foreach |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | new FrmNotification(); |
| 606 | 606 | |
| 607 | 607 | foreach ( $action_priority as $action_id => $priority ) { |
| 608 | - $action = $stored_actions[ $action_id ]; |
|
| 608 | + $action = $stored_actions[$action_id]; |
|
| 609 | 609 | |
| 610 | 610 | /** |
| 611 | 611 | * Allows custom form action trigger. |
@@ -669,12 +669,12 @@ discard block |
||
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | public function register( $action_class ) { |
| 672 | - $this->actions[ $action_class ] = new $action_class(); |
|
| 672 | + $this->actions[$action_class] = new $action_class(); |
|
| 673 | 673 | } |
| 674 | 674 | |
| 675 | 675 | public function unregister( $action_class ) { |
| 676 | - if ( isset( $this->actions[ $action_class ] ) ) { |
|
| 677 | - unset( $this->actions[ $action_class ] ); |
|
| 676 | + if ( isset( $this->actions[$action_class] ) ) { |
|
| 677 | + unset( $this->actions[$action_class] ); |
|
| 678 | 678 | } |
| 679 | 679 | } |
| 680 | 680 | |
@@ -683,8 +683,8 @@ discard block |
||
| 683 | 683 | |
| 684 | 684 | foreach ( $keys as $key ) { |
| 685 | 685 | // don't register new action if old action with the same id is already registered |
| 686 | - if ( ! isset( $this->actions[ $key ] ) ) { |
|
| 687 | - $this->actions[ $key ]->_register(); |
|
| 686 | + if ( ! isset( $this->actions[$key] ) ) { |
|
| 687 | + $this->actions[$key]->_register(); |
|
| 688 | 688 | } |
| 689 | 689 | } |
| 690 | 690 | } |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | } |
| 50 | 50 | $errors = array(); |
| 51 | 51 | if ( false !== strpos( $args['value'], '.@' ) || ! is_email( $args['value'] ) ) { |
| 52 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 52 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 53 | 53 | } |
| 54 | 54 | return $errors; |
| 55 | 55 | } |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | public static function load_admin_hooks() { |
| 37 | 37 | add_action( |
| 38 | 38 | 'admin_init', |
| 39 | - function () { |
|
| 39 | + function() { |
|
| 40 | 40 | self::fix_addon_hooks(); |
| 41 | 41 | } |
| 42 | 42 | ); |
@@ -127,7 +127,7 @@ |
||
| 127 | 127 | * @return bool |
| 128 | 128 | */ |
| 129 | 129 | private static function check_free_segments( $who ) { |
| 130 | - $segments = array( |
|
| 130 | + $segments = array( |
|
| 131 | 131 | 'free_first_1', |
| 132 | 132 | 'free_first_2_3', |
| 133 | 133 | 'free_first_4_7', |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | // Validate the number format. |
| 64 | 64 | if ( ! is_numeric( $args['value'] ) && '' !== $args['value'] ) { |
| 65 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 65 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | if ( $args['value'] === '' ) { |
@@ -74,9 +74,9 @@ discard block |
||
| 74 | 74 | $maxnum = FrmField::get_option( $this->field, 'maxnum' ); |
| 75 | 75 | |
| 76 | 76 | if ( $minnum !== '' && $value < $minnum ) { |
| 77 | - $errors[ 'field' . $args['id'] ] = __( 'Please select a higher number', 'formidable' ); |
|
| 77 | + $errors['field' . $args['id']] = __( 'Please select a higher number', 'formidable' ); |
|
| 78 | 78 | } elseif ( $maxnum !== '' && $value > $maxnum ) { |
| 79 | - $errors[ 'field' . $args['id'] ] = __( 'Please select a lower number', 'formidable' ); |
|
| 79 | + $errors['field' . $args['id']] = __( 'Please select a lower number', 'formidable' ); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | $this->validate_step( $errors, $args ); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * @return void |
| 96 | 96 | */ |
| 97 | 97 | protected function validate_step( &$errors, $args ) { |
| 98 | - if ( isset( $errors[ 'field' . $args['id'] ] ) ) { |
|
| 98 | + if ( isset( $errors['field' . $args['id']] ) ) { |
|
| 99 | 99 | // Don't need to check if value is invalid before. |
| 100 | 100 | return; |
| 101 | 101 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | return; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - $errors[ 'field' . $args['id'] ] = sprintf( |
|
| 113 | + $errors['field' . $args['id']] = sprintf( |
|
| 114 | 114 | // Translators: %1$s: the first nearest value; %2$s: the second nearest value. |
| 115 | 115 | __( 'Please enter a valid value. Two nearest valid values are %1$s and %2$s', 'formidable' ), |
| 116 | 116 | is_numeric( $result[0] ) ? floatval( $result[0] ) : $result[0], |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $page = $this->get_pagenum(); |
| 29 | 29 | $per_page = $this->get_items_per_page( 'formidable_page_formidable_per_page' ); |
| 30 | 30 | |
| 31 | - $mode = self::get_param( |
|
| 31 | + $mode = self::get_param( |
|
| 32 | 32 | array( |
| 33 | 33 | 'param' => 'mode', |
| 34 | 34 | 'default' => 'list', |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | 'default' => 'name', |
| 41 | 41 | ) |
| 42 | 42 | ); |
| 43 | - $order = self::get_param( |
|
| 43 | + $order = self::get_param( |
|
| 44 | 44 | array( |
| 45 | 45 | 'param' => 'order', |
| 46 | 46 | 'default' => 'ASC', |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | FrmAppController::apply_saved_sort_preference( $orderby, $order ); |
| 51 | 51 | |
| 52 | - $start = self::get_param( |
|
| 52 | + $start = self::get_param( |
|
| 53 | 53 | array( |
| 54 | 54 | 'param' => 'start', |
| 55 | 55 | 'default' => ( $page - 1 ) * $per_page, |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $counts = FrmForm::get_count(); |
| 182 | 182 | $form_type = FrmAppHelper::simple_get( 'form_type', 'sanitize_title', 'published' ); |
| 183 | 183 | |
| 184 | - if ( isset( $statuses[ $form_type ] ) ) { |
|
| 184 | + if ( isset( $statuses[$form_type] ) ) { |
|
| 185 | 185 | $counts->$form_type = $this->total_items; |
| 186 | 186 | } |
| 187 | 187 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | if ( $counts->{$status} || 'draft' !== $status ) { |
| 204 | 204 | /* translators: %1$s: Status, %2$s: Number of items */ |
| 205 | - $links[ $status ] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
| 205 | + $links[$status] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | unset( $status, $name ); |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | private function get_actions( &$actions, $item, $edit_link ) { |
| 405 | 405 | $new_actions = FrmFormsHelper::get_action_links( $item->id, $item ); |
| 406 | 406 | foreach ( $new_actions as $link => $action ) { |
| 407 | - $new_actions[ $link ] = FrmFormsHelper::format_link_html( $action, 'short' ); |
|
| 407 | + $new_actions[$link] = FrmFormsHelper::format_link_html( $action, 'short' ); |
|
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | if ( 'trash' === $this->status ) { |
@@ -1889,7 +1889,8 @@ discard block |
||
| 1889 | 1889 | $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; |
| 1890 | 1890 | $vars = array(); |
| 1891 | 1891 | FrmAppHelper::include_svg(); |
| 1892 | - if ( isset( $_POST['frm_compact_fields'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1892 | + if ( isset( $_POST['frm_compact_fields'] ) ) { |
|
| 1893 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1893 | 1894 | FrmAppHelper::permission_check( 'frm_edit_forms' ); |
| 1894 | 1895 | |
| 1895 | 1896 | // Javascript needs to be allowed in some field settings. |
@@ -2314,7 +2315,8 @@ discard block |
||
| 2314 | 2315 | private static function get_saved_errors( $form, $params ) { |
| 2315 | 2316 | global $frm_vars; |
| 2316 | 2317 | |
| 2317 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 2318 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { |
|
| 2319 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 2318 | 2320 | $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
| 2319 | 2321 | } else { |
| 2320 | 2322 | $errors = array(); |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | * @param string|null $src |
| 720 | 720 | * @return string |
| 721 | 721 | */ |
| 722 | - function ( $src ) { |
|
| 722 | + function( $src ) { |
|
| 723 | 723 | if ( is_null( $src ) ) { |
| 724 | 724 | $src = ''; |
| 725 | 725 | } |
@@ -784,11 +784,11 @@ discard block |
||
| 784 | 784 | ), |
| 785 | 785 | ); |
| 786 | 786 | |
| 787 | - if ( ! isset( $available_status[ $status ] ) ) { |
|
| 787 | + if ( ! isset( $available_status[$status] ) ) { |
|
| 788 | 788 | return; |
| 789 | 789 | } |
| 790 | 790 | |
| 791 | - FrmAppHelper::permission_check( $available_status[ $status ]['permission'] ); |
|
| 791 | + FrmAppHelper::permission_check( $available_status[$status]['permission'] ); |
|
| 792 | 792 | |
| 793 | 793 | $params = FrmForm::list_page_params(); |
| 794 | 794 | |
@@ -796,8 +796,8 @@ discard block |
||
| 796 | 796 | check_admin_referer( $status . '_form_' . $params['id'] ); |
| 797 | 797 | |
| 798 | 798 | $count = 0; |
| 799 | - if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) { |
|
| 800 | - ++$count; |
|
| 799 | + if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) { |
|
| 800 | + ++ $count; |
|
| 801 | 801 | } |
| 802 | 802 | |
| 803 | 803 | $form_type = FrmAppHelper::get_simple_request( |
@@ -813,7 +813,7 @@ discard block |
||
| 813 | 813 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
| 814 | 814 | $available_status['trash']['message'] = sprintf( _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), $count, '<a href="' . esc_url( wp_nonce_url( '?page=formidable&frm_action=untrash&form_type=' . $form_type . '&id=' . $params['id'], 'untrash_form_' . $params['id'] ) ) . '">', '</a>' ); |
| 815 | 815 | |
| 816 | - $message = $available_status[ $status ]['message']; |
|
| 816 | + $message = $available_status[$status]['message']; |
|
| 817 | 817 | |
| 818 | 818 | self::display_forms_list( $params, $message ); |
| 819 | 819 | } |
@@ -828,7 +828,7 @@ discard block |
||
| 828 | 828 | $count = 0; |
| 829 | 829 | foreach ( $ids as $id ) { |
| 830 | 830 | if ( FrmForm::trash( $id ) ) { |
| 831 | - ++$count; |
|
| 831 | + ++ $count; |
|
| 832 | 832 | } |
| 833 | 833 | } |
| 834 | 834 | |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | 'type' => 'request', |
| 843 | 843 | ) |
| 844 | 844 | ); |
| 845 | - $message = sprintf( |
|
| 845 | + $message = sprintf( |
|
| 846 | 846 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
| 847 | 847 | _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), |
| 848 | 848 | $count, |
@@ -863,7 +863,7 @@ discard block |
||
| 863 | 863 | |
| 864 | 864 | $count = 0; |
| 865 | 865 | if ( FrmForm::destroy( $params['id'] ) ) { |
| 866 | - ++$count; |
|
| 866 | + ++ $count; |
|
| 867 | 867 | } |
| 868 | 868 | |
| 869 | 869 | /* translators: %1$s: Number of forms */ |
@@ -883,7 +883,7 @@ discard block |
||
| 883 | 883 | foreach ( $ids as $id ) { |
| 884 | 884 | $d = FrmForm::destroy( $id ); |
| 885 | 885 | if ( $d ) { |
| 886 | - ++$count; |
|
| 886 | + ++ $count; |
|
| 887 | 887 | } |
| 888 | 888 | } |
| 889 | 889 | |
@@ -1384,7 +1384,7 @@ discard block |
||
| 1384 | 1384 | |
| 1385 | 1385 | add_action( |
| 1386 | 1386 | 'wp_enqueue_editor', |
| 1387 | - function () { |
|
| 1387 | + function() { |
|
| 1388 | 1388 | wp_print_media_templates(); |
| 1389 | 1389 | } |
| 1390 | 1390 | ); |
@@ -1493,7 +1493,7 @@ discard block |
||
| 1493 | 1493 | |
| 1494 | 1494 | foreach ( array( 'landing', 'chat', 'abandonment' ) as $feature ) { |
| 1495 | 1495 | if ( ! FrmAppHelper::show_new_feature( $feature ) ) { |
| 1496 | - unset( $sections[ $feature ] ); |
|
| 1496 | + unset( $sections[$feature] ); |
|
| 1497 | 1497 | } |
| 1498 | 1498 | } |
| 1499 | 1499 | |
@@ -1521,7 +1521,7 @@ discard block |
||
| 1521 | 1521 | $section['id'] = $section['anchor']; |
| 1522 | 1522 | } |
| 1523 | 1523 | |
| 1524 | - $sections[ $key ] = $section; |
|
| 1524 | + $sections[$key] = $section; |
|
| 1525 | 1525 | }//end foreach |
| 1526 | 1526 | |
| 1527 | 1527 | return $sections; |
@@ -1644,7 +1644,7 @@ discard block |
||
| 1644 | 1644 | if ( $user_fields ) { |
| 1645 | 1645 | $user_helpers = array(); |
| 1646 | 1646 | foreach ( $user_fields as $uk => $uf ) { |
| 1647 | - $user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf; |
|
| 1647 | + $user_helpers['|user_id| show="' . $uk . '"'] = $uf; |
|
| 1648 | 1648 | unset( $uk, $uf ); |
| 1649 | 1649 | } |
| 1650 | 1650 | |
@@ -1778,7 +1778,7 @@ discard block |
||
| 1778 | 1778 | if ( ! isset( $frm_vars['js_validate_forms'] ) ) { |
| 1779 | 1779 | $frm_vars['js_validate_forms'] = array(); |
| 1780 | 1780 | } |
| 1781 | - $frm_vars['js_validate_forms'][ $form->id ] = $form; |
|
| 1781 | + $frm_vars['js_validate_forms'][$form->id] = $form; |
|
| 1782 | 1782 | } |
| 1783 | 1783 | |
| 1784 | 1784 | public static function get_email_html() { |
@@ -1962,7 +1962,7 @@ discard block |
||
| 1962 | 1962 | add_filter( 'frm_validate_form', 'FrmFormsController::json_error' ); |
| 1963 | 1963 | } else { |
| 1964 | 1964 | $vars = FrmAppHelper::json_to_array( $json_vars ); |
| 1965 | - $action = $vars[ $action ]; |
|
| 1965 | + $action = $vars[$action]; |
|
| 1966 | 1966 | unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1967 | 1967 | $_REQUEST = array_merge( $_REQUEST, $vars ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1968 | 1968 | $_POST = array_merge( $_POST, $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
@@ -2125,7 +2125,7 @@ discard block |
||
| 2125 | 2125 | $actions = array(); |
| 2126 | 2126 | foreach ( $frm_vars['forms_loaded'] as $form ) { |
| 2127 | 2127 | if ( is_object( $form ) ) { |
| 2128 | - $actions[ $form->id ] = $form->name; |
|
| 2128 | + $actions[$form->id] = $form->name; |
|
| 2129 | 2129 | } |
| 2130 | 2130 | unset( $form ); |
| 2131 | 2131 | } |
@@ -2370,8 +2370,8 @@ discard block |
||
| 2370 | 2370 | private static function get_saved_errors( $form, $params ) { |
| 2371 | 2371 | global $frm_vars; |
| 2372 | 2372 | |
| 2373 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 2374 | - $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
|
| 2373 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 2374 | + $errors = $frm_vars['created_entries'][$form->id]['errors']; |
|
| 2375 | 2375 | } else { |
| 2376 | 2376 | $errors = array(); |
| 2377 | 2377 | } |
@@ -2393,7 +2393,7 @@ discard block |
||
| 2393 | 2393 | public static function just_created_entry( $form_id ) { |
| 2394 | 2394 | global $frm_vars; |
| 2395 | 2395 | |
| 2396 | - return isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][ $form_id ] ) && isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ? $frm_vars['created_entries'][ $form_id ]['entry_id'] : 0; |
|
| 2396 | + return isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][$form_id] ) && isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ? $frm_vars['created_entries'][$form_id]['entry_id'] : 0; |
|
| 2397 | 2397 | } |
| 2398 | 2398 | |
| 2399 | 2399 | /** |
@@ -2413,7 +2413,7 @@ discard block |
||
| 2413 | 2413 | private static function get_confirmation_method( $atts ) { |
| 2414 | 2414 | $action = FrmOnSubmitHelper::current_event( $atts ); |
| 2415 | 2415 | $opt = 'update' === $action ? 'edit_action' : 'success_action'; |
| 2416 | - $method = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message'; |
|
| 2416 | + $method = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message'; |
|
| 2417 | 2417 | |
| 2418 | 2418 | if ( ! empty( $atts['entry_id'] ) ) { |
| 2419 | 2419 | $met_actions = self::get_met_on_submit_actions( $atts, $action ); |
@@ -2434,7 +2434,7 @@ discard block |
||
| 2434 | 2434 | public static function maybe_trigger_redirect( $form, $params, $args ) { |
| 2435 | 2435 | if ( ! isset( $params['id'] ) ) { |
| 2436 | 2436 | global $frm_vars; |
| 2437 | - $params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id']; |
|
| 2437 | + $params['id'] = $frm_vars['created_entries'][$form->id]['entry_id']; |
|
| 2438 | 2438 | } |
| 2439 | 2439 | |
| 2440 | 2440 | $conf_method = self::get_confirmation_method( |
@@ -2516,7 +2516,7 @@ discard block |
||
| 2516 | 2516 | $args['success_opt'] = $opt; |
| 2517 | 2517 | $args['ajax'] = ! empty( $frm_vars['ajax'] ); |
| 2518 | 2518 | |
| 2519 | - if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) { |
|
| 2519 | + if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) { |
|
| 2520 | 2520 | self::load_page_after_submit( $args ); |
| 2521 | 2521 | } elseif ( $args['conf_method'] === 'redirect' ) { |
| 2522 | 2522 | self::redirect_after_submit( $args ); |
@@ -2540,7 +2540,7 @@ discard block |
||
| 2540 | 2540 | } |
| 2541 | 2541 | |
| 2542 | 2542 | // If a redirect action has already opened the URL in a new tab, we show the default message in the current tab. |
| 2543 | - if ( ! empty( self::$redirected_in_new_tab[ $args['form']->id ] ) ) { |
|
| 2543 | + if ( ! empty( self::$redirected_in_new_tab[$args['form']->id] ) ) { |
|
| 2544 | 2544 | return array( FrmOnSubmitHelper::get_fallback_action_after_open_in_new_tab( $event ) ); |
| 2545 | 2545 | } |
| 2546 | 2546 | |
@@ -2728,7 +2728,7 @@ discard block |
||
| 2728 | 2728 | |
| 2729 | 2729 | $opt = 'update' === $args['action'] ? 'edit_' : 'success_'; |
| 2730 | 2730 | |
| 2731 | - $new_args['conf_method'] = $new_args['form']->options[ $opt . 'action' ]; |
|
| 2731 | + $new_args['conf_method'] = $new_args['form']->options[$opt . 'action']; |
|
| 2732 | 2732 | |
| 2733 | 2733 | /** |
| 2734 | 2734 | * Filters the run success action args. |
@@ -2748,8 +2748,8 @@ discard block |
||
| 2748 | 2748 | private static function load_page_after_submit( $args ) { |
| 2749 | 2749 | global $post; |
| 2750 | 2750 | $opt = $args['success_opt']; |
| 2751 | - if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) { |
|
| 2752 | - $page = get_post( $args['form']->options[ $opt . '_page_id' ] ); |
|
| 2751 | + if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) { |
|
| 2752 | + $page = get_post( $args['form']->options[$opt . '_page_id'] ); |
|
| 2753 | 2753 | $old_post = $post; |
| 2754 | 2754 | $post = $page; |
| 2755 | 2755 | $content = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] ); |
@@ -2779,7 +2779,7 @@ discard block |
||
| 2779 | 2779 | add_filter( 'frm_use_wpautop', '__return_false' ); |
| 2780 | 2780 | |
| 2781 | 2781 | $opt = $args['success_opt']; |
| 2782 | - $success_url = trim( $args['form']->options[ $opt . '_url' ] ); |
|
| 2782 | + $success_url = trim( $args['form']->options[$opt . '_url'] ); |
|
| 2783 | 2783 | $success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] ); |
| 2784 | 2784 | $success_url = do_shortcode( $success_url ); |
| 2785 | 2785 | |
@@ -2801,7 +2801,7 @@ discard block |
||
| 2801 | 2801 | // Not AJAX submit, no headers sent, and there is just one Redirect action runs. |
| 2802 | 2802 | if ( ! empty( $args['form']->options['open_in_new_tab'] ) ) { |
| 2803 | 2803 | self::print_open_in_new_tab_js_with_fallback_handler( $success_url, $args ); |
| 2804 | - self::$redirected_in_new_tab[ $args['form']->id ] = 1; |
|
| 2804 | + self::$redirected_in_new_tab[$args['form']->id] = 1; |
|
| 2805 | 2805 | return; |
| 2806 | 2806 | } |
| 2807 | 2807 | |
@@ -3081,7 +3081,7 @@ discard block |
||
| 3081 | 3081 | 'description' => false, |
| 3082 | 3082 | 'reset' => false, |
| 3083 | 3083 | ); |
| 3084 | - $args = wp_parse_args( $args, $defaults ); |
|
| 3084 | + $args = wp_parse_args( $args, $defaults ); |
|
| 3085 | 3085 | } |
| 3086 | 3086 | |
| 3087 | 3087 | /** |
@@ -3119,7 +3119,7 @@ discard block |
||
| 3119 | 3119 | $opt = $args['success_opt'] ?? 'success'; |
| 3120 | 3120 | |
| 3121 | 3121 | if ( $entry_id && is_numeric( $entry_id ) ) { |
| 3122 | - $message = $form->options[ $opt . '_msg' ] ?? $frm_settings->success_msg; |
|
| 3122 | + $message = $form->options[$opt . '_msg'] ?? $frm_settings->success_msg; |
|
| 3123 | 3123 | $class = 'frm_message'; |
| 3124 | 3124 | } else { |
| 3125 | 3125 | $message = $frm_settings->failed_msg; |
@@ -3344,8 +3344,8 @@ discard block |
||
| 3344 | 3344 | |
| 3345 | 3345 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
| 3346 | 3346 | |
| 3347 | - $html = FrmAppHelper::clip( |
|
| 3348 | - function () { |
|
| 3347 | + $html = FrmAppHelper::clip( |
|
| 3348 | + function() { |
|
| 3349 | 3349 | FrmAppHelper::maybe_autocomplete_pages_options( |
| 3350 | 3350 | array( |
| 3351 | 3351 | 'field_name' => 'frm_page_dropdown', |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | * @return array |
| 54 | 54 | */ |
| 55 | 55 | public static function add_gdpr_field( $fields ) { |
| 56 | - $fields[ self::FIELD_TYPE ] = array( |
|
| 56 | + $fields[self::FIELD_TYPE] = array( |
|
| 57 | 57 | 'name' => __( 'GDPR', 'formidable' ), |
| 58 | 58 | 'icon' => 'frm_icon_font frm-gdpr-icon', |
| 59 | 59 | ); |
@@ -76,10 +76,10 @@ |
||
| 76 | 76 | foreach ( $pro_fields as $field_key => $field_type ) { |
| 77 | 77 | |
| 78 | 78 | if ( isset( $field_type['section'] ) ) { |
| 79 | - if ( ! isset( $field_sections[ $field_type['section'] ] ) ) { |
|
| 80 | - $field_sections[ $field_type['section'] ] = array(); |
|
| 79 | + if ( ! isset( $field_sections[$field_type['section']] ) ) { |
|
| 80 | + $field_sections[$field_type['section']] = array(); |
|
| 81 | 81 | } |
| 82 | - $field_sections[ $field_type['section'] ][ $field_key ] = $field_type; |
|
| 82 | + $field_sections[$field_type['section']][$field_key] = $field_type; |
|
| 83 | 83 | continue; |
| 84 | 84 | } |
| 85 | 85 | |