@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * Try subkeys after split. |
92 | 92 | */ |
93 | 93 | if ( count( $parts = explode( '/', $key, 2 ) ) > 1 ) { |
94 | - return self::get( self::get( $array, $parts[0] ), $parts[1], $default ); |
|
94 | + return self::get( self::get( $array, $parts[ 0 ] ), $parts[ 1 ], $default ); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | return $default; |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | public static function gf_query_debug( $query ) { |
146 | 146 | $introspect = $query->_introspect(); |
147 | 147 | return array( |
148 | - 'where' => $query->_where_unwrap( $introspect['where'] ) |
|
148 | + 'where' => $query->_where_unwrap( $introspect[ 'where' ] ) |
|
149 | 149 | ); |
150 | 150 | } |
151 | 151 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | if ( $condition->expressions ) { |
159 | 159 | $conditions = array(); |
160 | 160 | foreach ( $condition->expressions as $expression ) { |
161 | - $conditions[] = self::gf_query_strip_condition_column_aliases( $expression ); |
|
161 | + $conditions[ ] = self::gf_query_strip_condition_column_aliases( $expression ); |
|
162 | 162 | } |
163 | 163 | return call_user_func_array( |
164 | 164 | array( '\GF_Query_Condition', $condition->operator == 'AND' ? '_and' : '_or' ), |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
49 | 49 | |
50 | - if( 'edit' === $context ) { |
|
50 | + if ( 'edit' === $context ) { |
|
51 | 51 | return $field_options; |
52 | 52 | } |
53 | 53 | |
54 | - $this->add_field_support('date_display', $field_options ); |
|
54 | + $this->add_field_support( 'date_display', $field_options ); |
|
55 | 55 | |
56 | 56 | return $field_options; |
57 | 57 | } |
@@ -71,11 +71,11 @@ discard block |
||
71 | 71 | public function get_content( $output = '', $entry = array(), $field_settings = array(), $field = array() ) { |
72 | 72 | |
73 | 73 | /** Overridden by a template. */ |
74 | - if( \GV\Utils::get( $field, 'field_path' ) !== gravityview()->plugin->dir( 'templates/fields/field-html.php' ) ) { |
|
74 | + if ( \GV\Utils::get( $field, 'field_path' ) !== gravityview()->plugin->dir( 'templates/fields/field-html.php' ) ) { |
|
75 | 75 | return $output; |
76 | 76 | } |
77 | 77 | |
78 | - return GVCommon::format_date( $field['value'], 'format=' . \GV\Utils::get( $field_settings, 'date_display' ) ); |
|
78 | + return GVCommon::format_date( $field[ 'value' ], 'format=' . \GV\Utils::get( $field_settings, 'date_display' ) ); |
|
79 | 79 | } |
80 | 80 | } |
81 | 81 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | parent::add_hooks(); |
35 | 35 | |
36 | - add_filter( 'gravityview/search/searchable_fields', array( $this, 'modify_search_bar_fields_dropdown'), 10, 2 ); |
|
36 | + add_filter( 'gravityview/search/searchable_fields', array( $this, 'modify_search_bar_fields_dropdown' ), 10, 2 ); |
|
37 | 37 | |
38 | 38 | add_filter( 'gravityview/admin/available_fields', array( $this, 'maybe_add_non_default_fields' ), 10, 3 ); |
39 | 39 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @return void |
54 | 54 | */ |
55 | 55 | public function clear_cache_after_workflow( $form, $entry_id, $step_id, $starting_step_id ) { |
56 | - do_action( 'gravityview_clear_form_cache', $form['id'] ); |
|
56 | + do_action( 'gravityview_clear_form_cache', $form[ 'id' ] ); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public static function get_status_options( $form_id = 0, $status_key = 'workflow_final_status' ) { |
72 | 72 | |
73 | - if( empty( $form_id ) ) { |
|
73 | + if ( empty( $form_id ) ) { |
|
74 | 74 | $form_id = GravityView_View::getInstance()->getFormId(); |
75 | 75 | } |
76 | 76 | |
77 | 77 | $entry_meta = gravity_flow()->get_entry_meta( array(), $form_id ); |
78 | 78 | |
79 | - return (array) \GV\Utils::get( $entry_meta, $status_key . '/filter/choices' ); |
|
79 | + return (array)\GV\Utils::get( $entry_meta, $status_key . '/filter/choices' ); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | $workflow_steps = $GFlow->get_steps(); |
100 | 100 | |
101 | - if( $workflow_steps ) { |
|
101 | + if ( $workflow_steps ) { |
|
102 | 102 | |
103 | 103 | foreach ( $workflow_steps as $step ) { |
104 | 104 | |
@@ -110,12 +110,12 @@ discard block |
||
110 | 110 | ); |
111 | 111 | } |
112 | 112 | |
113 | - $fields['workflow_step'] = array( |
|
113 | + $fields[ 'workflow_step' ] = array( |
|
114 | 114 | 'label' => esc_html__( 'Workflow Step', 'gravityview' ), |
115 | 115 | 'type' => 'select', |
116 | 116 | ); |
117 | 117 | |
118 | - $fields['workflow_final_status'] = array( |
|
118 | + $fields[ 'workflow_final_status' ] = array( |
|
119 | 119 | 'label' => esc_html__( 'Workflow Status', 'gravityview' ), |
120 | 120 | 'type' => 'select', |
121 | 121 | ); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | if ( ( $insert_at = array_search( 'workflow_final_status', wp_list_pluck( $fields, 'key' ) ) ) !== false ) { |
132 | 132 | $fields_end = array_splice( $fields, $insert_at + 1 ); |
133 | 133 | |
134 | - $fields[] = array( |
|
134 | + $fields[ ] = array( |
|
135 | 135 | 'text' => __( 'Workflow Current Status Timestamp', 'gravityview' ), |
136 | 136 | 'operators' => array( '>', '<' ), |
137 | 137 | 'placeholder' => 'yyyy-mm-dd', |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | $keys_end = array_splice( $keys, $insert_at + 1 ); |
158 | 158 | $values_end = array_splice( $values, $insert_at + 1 ); |
159 | 159 | |
160 | - $keys[] = 'workflow_current_status_timestamp'; |
|
161 | - $values[] = array( |
|
160 | + $keys[ ] = 'workflow_current_status_timestamp'; |
|
161 | + $values[ ] = array( |
|
162 | 162 | 'label' => __( 'Workflow Current Status Timestamp', 'gravityview' ), |
163 | 163 | 'type' => 'workflow_current_status_timestamp', |
164 | 164 | ); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function set_provider( $provider = null ) { |
40 | 40 | |
41 | - if( gravityview()->request->is_admin() ) { |
|
41 | + if ( gravityview()->request->is_admin() ) { |
|
42 | 42 | return; |
43 | 43 | } |
44 | 44 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | // We're switching providers; remove the hooks that were added. |
60 | - if( self::$active_provider ) { |
|
60 | + if ( self::$active_provider ) { |
|
61 | 61 | self::$active_provider->remove_hooks(); |
62 | 62 | } |
63 | 63 |
@@ -21,13 +21,13 @@ |
||
21 | 21 | $plugin_hooks_files = glob( $include_path . 'class-gravityview-plugin-hooks-*.php' ); |
22 | 22 | |
23 | 23 | // Load all plugin files automatically |
24 | -foreach ( (array) $plugin_hooks_files as $plugin_hooks_file ) { |
|
24 | +foreach ( (array)$plugin_hooks_files as $plugin_hooks_file ) { |
|
25 | 25 | include $plugin_hooks_file; |
26 | 26 | } |
27 | 27 | |
28 | 28 | $theme_hooks_files = glob( $include_path . 'class-gravityview-theme-hooks-*.php' ); |
29 | 29 | |
30 | 30 | // Load all theme files automatically |
31 | -foreach ( (array) $theme_hooks_files as $theme_hooks_file ) { |
|
31 | +foreach ( (array)$theme_hooks_files as $theme_hooks_file ) { |
|
32 | 32 | include $theme_hooks_file; |
33 | 33 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | add_filter( 'icl_ls_languages', array( $this, 'wpml_ls_filter' ) ); |
66 | 66 | |
67 | - add_filter( 'gravityview_directory_link', array( $this, 'filter_gravityview_back_link') ); |
|
67 | + add_filter( 'gravityview_directory_link', array( $this, 'filter_gravityview_back_link' ) ); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | function filter_gravityview_back_link( $link ) { |
85 | 85 | global $wpml_url_filters; |
86 | 86 | |
87 | - if( $wpml_url_filters ) { |
|
87 | + if ( $wpml_url_filters ) { |
|
88 | 88 | $link = $wpml_url_filters->permalink_filter( $link, GravityView_frontend::getInstance()->getPostId() ); |
89 | 89 | } |
90 | 90 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | private function remove_url_hooks() { |
102 | 102 | global $wpml_url_filters; |
103 | 103 | |
104 | - if( ! $wpml_url_filters ) { |
|
104 | + if ( ! $wpml_url_filters ) { |
|
105 | 105 | return; |
106 | 106 | } |
107 | 107 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | private function add_url_hooks() { |
130 | 130 | global $wpml_url_filters; |
131 | 131 | |
132 | - if( ! $wpml_url_filters ) { |
|
132 | + if ( ! $wpml_url_filters ) { |
|
133 | 133 | return; |
134 | 134 | } |
135 | 135 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | break; |
227 | 227 | } |
228 | 228 | |
229 | - $languages[ $lang_code ]['url'] = $entry_link; |
|
229 | + $languages[ $lang_code ][ 'url' ] = $entry_link; |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | $this->add_url_hooks(); |
@@ -421,7 +421,7 @@ |
||
421 | 421 | </header> |
422 | 422 | <div class="gform-settings-panel__content" style="padding: 0 1rem 1.25rem"> |
423 | 423 | |
424 | -HTML; |
|
424 | +html; |
|
425 | 425 | } else { |
426 | 426 | echo '<div class="gv-uninstall-form-wrapper" style="font-size: 110%; padding: 15px 0;">'; |
427 | 427 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $setting_tabs = parent::get_app_settings_tabs(); |
119 | 119 | |
120 | 120 | foreach ( $setting_tabs as &$tab ) { |
121 | - if ( 'uninstall' !== $tab['name'] ) { |
|
121 | + if ( 'uninstall' !== $tab[ 'name' ] ) { |
|
122 | 122 | continue; |
123 | 123 | } |
124 | 124 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | // Add trash can icon to resemble the look and feel of the GF Settings page |
132 | - $tab['icon'] = 'dashicons-trash'; |
|
132 | + $tab[ 'icon' ] = 'dashicons-trash'; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | return array_filter( $setting_tabs ); |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | */ |
145 | 145 | public function register_no_conflict( $items ) { |
146 | 146 | |
147 | - $items[] = 'gform_settings'; |
|
148 | - $items[] = 'gv-admin-edd-license'; |
|
147 | + $items[ ] = 'gform_settings'; |
|
148 | + $items[ ] = 'gv-admin-edd-license'; |
|
149 | 149 | |
150 | 150 | return $items; |
151 | 151 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | $href = add_query_arg( array( 'post_type' => 'gravityview', 'page' => 'gravityview_settings', 'view' => 'uninstall' ), admin_url( 'edit.php' ) ); |
198 | 198 | |
199 | - $uninstall_button = '<a href="' . esc_url( $href ) . '" class="' . gravityview_sanitize_html_class( $html_class ). '">' . esc_html__( 'Uninstall GravityView', 'gravityview' ) . '</a>'; |
|
199 | + $uninstall_button = '<a href="' . esc_url( $href ) . '" class="' . gravityview_sanitize_html_class( $html_class ) . '">' . esc_html__( 'Uninstall GravityView', 'gravityview' ) . '</a>'; |
|
200 | 200 | |
201 | 201 | $html .= $uninstall_button; |
202 | 202 | |
@@ -215,10 +215,10 @@ discard block |
||
215 | 215 | */ |
216 | 216 | public function settings_save( $field, $echo = true ) { |
217 | 217 | |
218 | - $field['type'] = 'submit'; |
|
219 | - $field['name'] = 'gform-settings-save'; |
|
220 | - $field['class'] = 'button button-primary primary button-hero'; |
|
221 | - $field['value'] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
218 | + $field[ 'type' ] = 'submit'; |
|
219 | + $field[ 'name' ] = 'gform-settings-save'; |
|
220 | + $field[ 'class' ] = 'button button-primary primary button-hero'; |
|
221 | + $field[ 'value' ] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
222 | 222 | |
223 | 223 | $html = $this->as_html( $field, false ); |
224 | 224 | |
@@ -240,8 +240,8 @@ discard block |
||
240 | 240 | */ |
241 | 241 | public function modify_app_settings_menu_title( $setting_tabs ) { |
242 | 242 | |
243 | - $setting_tabs[0]['label'] = __( 'GravityView Settings', 'gravityview' ); |
|
244 | - $setting_tabs[0]['icon'] = 'dashicons-admin-settings'; |
|
243 | + $setting_tabs[ 0 ][ 'label' ] = __( 'GravityView Settings', 'gravityview' ); |
|
244 | + $setting_tabs[ 0 ][ 'icon' ] = 'dashicons-admin-settings'; |
|
245 | 245 | |
246 | 246 | return $setting_tabs; |
247 | 247 | } |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | $i = 0; |
490 | 490 | while ( $i < 11 ) { |
491 | 491 | echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_' . $i . '" value="' . $i . '" type="radio"> ' . $i . '</label></li>'; |
492 | - $i ++; |
|
492 | + $i++; |
|
493 | 493 | } |
494 | 494 | ?> |
495 | 495 | </ul> |
@@ -695,14 +695,14 @@ discard block |
||
695 | 695 | */ |
696 | 696 | public function as_html( $field, $echo = true ) { |
697 | 697 | |
698 | - $field['type'] = ( isset( $field['type'] ) && in_array( $field['type'], array( 'submit', 'reset', 'button' ) ) ) ? $field['type'] : 'submit'; |
|
698 | + $field[ 'type' ] = ( isset( $field[ 'type' ] ) && in_array( $field[ 'type' ], array( 'submit', 'reset', 'button' ) ) ) ? $field[ 'type' ] : 'submit'; |
|
699 | 699 | |
700 | 700 | $attributes = $this->get_field_attributes( $field ); |
701 | 701 | $default_value = Utils::get( $field, 'value', Utils::get( $field, 'default_value' ) ); |
702 | - $value = $this->get( $field['name'], $default_value ); |
|
702 | + $value = $this->get( $field[ 'name' ], $default_value ); |
|
703 | 703 | |
704 | - $attributes['class'] = isset( $attributes['class'] ) ? esc_attr( $attributes['class'] ) : 'button-primary primary gfbutton'; |
|
705 | - $name = ( $field['name'] === 'gform-settings-save' ) ? $field['name'] : '_gaddon_setting_' . $field['name']; |
|
704 | + $attributes[ 'class' ] = isset( $attributes[ 'class' ] ) ? esc_attr( $attributes[ 'class' ] ) : 'button-primary primary gfbutton'; |
|
705 | + $name = ( $field[ 'name' ] === 'gform-settings-save' ) ? $field[ 'name' ] : '_gaddon_setting_' . $field[ 'name' ]; |
|
706 | 706 | |
707 | 707 | if ( empty( $value ) ) { |
708 | 708 | $value = __( 'Update Settings', 'gravityview' ); |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | $attributes = $this->get_field_attributes( $field ); |
712 | 712 | |
713 | 713 | $html = '<input |
714 | - type="' . $field['type'] . '" |
|
714 | + type="' . $field[ 'type' ] . '" |
|
715 | 715 | name="' . esc_attr( $name ) . '" |
716 | 716 | value="' . $value . '" ' . |
717 | 717 | implode( ' ', $attributes ) . |
@@ -745,7 +745,7 @@ discard block |
||
745 | 745 | */ |
746 | 746 | public function is_save_postback() { |
747 | 747 | |
748 | - return isset( $_POST['gform-settings-save'] ) && isset( $_POST['_gravityview_save_settings_nonce'] ); |
|
748 | + return isset( $_POST[ 'gform-settings-save' ] ) && isset( $_POST[ '_gravityview_save_settings_nonce' ] ); |
|
749 | 749 | } |
750 | 750 | |
751 | 751 | /** |
@@ -862,7 +862,7 @@ discard block |
||
862 | 862 | |
863 | 863 | $scripts = parent::scripts(); |
864 | 864 | |
865 | - $scripts[] = array( |
|
865 | + $scripts[ ] = array( |
|
866 | 866 | 'handle' => 'gform_tooltip_init', |
867 | 867 | 'enqueue' => array( |
868 | 868 | array( |
@@ -890,11 +890,11 @@ discard block |
||
890 | 890 | ); |
891 | 891 | |
892 | 892 | // This file was removed from 2.5 |
893 | - if( ! gravityview()->plugin->is_GF_25() ) { |
|
894 | - $deps[] = 'gform_tooltip'; |
|
893 | + if ( ! gravityview()->plugin->is_GF_25() ) { |
|
894 | + $deps[ ] = 'gform_tooltip'; |
|
895 | 895 | } |
896 | 896 | |
897 | - $styles[] = array( |
|
897 | + $styles[ ] = array( |
|
898 | 898 | 'handle' => 'gravityview_settings', |
899 | 899 | 'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
900 | 900 | 'version' => Plugin::$version, |
@@ -981,7 +981,7 @@ discard block |
||
981 | 981 | 'name' => 'support-email', |
982 | 982 | 'type' => 'text', |
983 | 983 | 'validate' => 'email', |
984 | - 'default_value' => $default_settings['support-email'], |
|
984 | + 'default_value' => $default_settings[ 'support-email' ], |
|
985 | 985 | 'label' => __( 'Support Email', 'gravityview' ), |
986 | 986 | 'description' => __( 'In order to provide responses to your support requests, please provide your email address.', 'gravityview' ), |
987 | 987 | 'class' => 'code regular-text', |
@@ -993,7 +993,7 @@ discard block |
||
993 | 993 | 'name' => 'support_port', |
994 | 994 | 'type' => 'radio', |
995 | 995 | 'label' => __( 'Show Support Port?', 'gravityview' ), |
996 | - 'default_value' => $default_settings['support_port'], |
|
996 | + 'default_value' => $default_settings[ 'support_port' ], |
|
997 | 997 | 'horizontal' => 1, |
998 | 998 | 'choices' => array( |
999 | 999 | array( |
@@ -1012,7 +1012,7 @@ discard block |
||
1012 | 1012 | 'name' => 'no-conflict-mode', |
1013 | 1013 | 'type' => 'radio', |
1014 | 1014 | 'label' => __( 'No-Conflict Mode', 'gravityview' ), |
1015 | - 'default_value' => $default_settings['no-conflict-mode'], |
|
1015 | + 'default_value' => $default_settings[ 'no-conflict-mode' ], |
|
1016 | 1016 | 'horizontal' => 1, |
1017 | 1017 | 'choices' => array( |
1018 | 1018 | array( |
@@ -1030,7 +1030,7 @@ discard block |
||
1030 | 1030 | 'name' => 'public-approval-link', |
1031 | 1031 | 'type' => 'radio', |
1032 | 1032 | 'label' => __( 'Public Approval Link', 'gravityview' ), |
1033 | - 'default_value' => $default_settings['public-approval-link'], |
|
1033 | + 'default_value' => $default_settings[ 'public-approval-link' ], |
|
1034 | 1034 | 'horizontal' => 1, |
1035 | 1035 | 'choices' => array( |
1036 | 1036 | array( |
@@ -1052,7 +1052,7 @@ discard block |
||
1052 | 1052 | 'name' => 'rest_api', |
1053 | 1053 | 'type' => 'radio', |
1054 | 1054 | 'label' => __( 'REST API', 'gravityview' ), |
1055 | - 'default_value' => $default_settings['rest_api'], |
|
1055 | + 'default_value' => $default_settings[ 'rest_api' ], |
|
1056 | 1056 | 'horizontal' => 1, |
1057 | 1057 | 'choices' => array( |
1058 | 1058 | array( |
@@ -1071,7 +1071,7 @@ discard block |
||
1071 | 1071 | 'name' => 'powered_by', |
1072 | 1072 | 'type' => 'checkbox', |
1073 | 1073 | 'label' => __( 'Display "Powered By" Link', 'gravityview' ), |
1074 | - 'default_value' => $default_settings['powered_by'], |
|
1074 | + 'default_value' => $default_settings[ 'powered_by' ], |
|
1075 | 1075 | 'choices' => array( |
1076 | 1076 | array( |
1077 | 1077 | 'label' => esc_html__( 'Display a "Powered by GravityView" link', 'gravityview' ), |
@@ -1096,7 +1096,7 @@ discard block |
||
1096 | 1096 | 'name' => 'beta', |
1097 | 1097 | 'type' => 'checkbox', |
1098 | 1098 | 'label' => __( 'Become a Beta Tester', 'gravityview' ), |
1099 | - 'default_value' => $default_settings['beta'], |
|
1099 | + 'default_value' => $default_settings[ 'beta' ], |
|
1100 | 1100 | 'horizontal' => 1, |
1101 | 1101 | 'choices' => array( |
1102 | 1102 | array( |
@@ -1130,17 +1130,17 @@ discard block |
||
1130 | 1130 | * @since 1.7.4 |
1131 | 1131 | */ |
1132 | 1132 | foreach ( $fields as &$field ) { |
1133 | - $field['name'] = isset( $field['name'] ) ? $field['name'] : Utils::get( $field, 'id' ); |
|
1134 | - $field['label'] = isset( $field['label'] ) ? $field['label'] : Utils::get( $field, 'title' ); |
|
1135 | - $field['default_value'] = isset( $field['default_value'] ) ? $field['default_value'] : Utils::get( $field, 'default' ); |
|
1136 | - $field['description'] = isset( $field['description'] ) ? $field['description'] : Utils::get( $field, 'subtitle' ); |
|
1133 | + $field[ 'name' ] = isset( $field[ 'name' ] ) ? $field[ 'name' ] : Utils::get( $field, 'id' ); |
|
1134 | + $field[ 'label' ] = isset( $field[ 'label' ] ) ? $field[ 'label' ] : Utils::get( $field, 'title' ); |
|
1135 | + $field[ 'default_value' ] = isset( $field[ 'default_value' ] ) ? $field[ 'default_value' ] : Utils::get( $field, 'default' ); |
|
1136 | + $field[ 'description' ] = isset( $field[ 'description' ] ) ? $field[ 'description' ] : Utils::get( $field, 'subtitle' ); |
|
1137 | 1137 | |
1138 | 1138 | if ( $disabled_attribute ) { |
1139 | - $field['disabled'] = $disabled_attribute; |
|
1139 | + $field[ 'disabled' ] = $disabled_attribute; |
|
1140 | 1140 | } |
1141 | 1141 | |
1142 | - if ( empty( $field['disabled'] ) ) { |
|
1143 | - unset( $field['disabled'] ); |
|
1142 | + if ( empty( $field[ 'disabled' ] ) ) { |
|
1143 | + unset( $field[ 'disabled' ] ); |
|
1144 | 1144 | } |
1145 | 1145 | } |
1146 | 1146 | |
@@ -1152,23 +1152,23 @@ discard block |
||
1152 | 1152 | 'description' => __( 'Enter the license key that was sent to you on purchase. This enables plugin updates & support.', 'gravityview' ), |
1153 | 1153 | 'type' => 'edd_license', |
1154 | 1154 | 'data-pending-text' => __( 'Verifying license…', 'gravityview' ), |
1155 | - 'default_value' => $default_settings['license_key'], |
|
1155 | + 'default_value' => $default_settings[ 'license_key' ], |
|
1156 | 1156 | 'class' => ( '' == $this->get( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key', |
1157 | 1157 | ), |
1158 | 1158 | array( |
1159 | 1159 | 'name' => 'license_key_response', |
1160 | - 'default_value' => $default_settings['license_key_response'], |
|
1160 | + 'default_value' => $default_settings[ 'license_key_response' ], |
|
1161 | 1161 | 'type' => 'hidden', |
1162 | 1162 | ), |
1163 | 1163 | array( |
1164 | 1164 | 'name' => 'license_key_status', |
1165 | - 'default_value' => $default_settings['license_key_status'], |
|
1165 | + 'default_value' => $default_settings[ 'license_key_status' ], |
|
1166 | 1166 | 'type' => 'hidden', |
1167 | 1167 | ), |
1168 | 1168 | ); |
1169 | 1169 | |
1170 | 1170 | if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
1171 | - $license_fields[0] = array_merge( $license_fields[0], array( |
|
1171 | + $license_fields[ 0 ] = array_merge( $license_fields[ 0 ], array( |
|
1172 | 1172 | 'disabled' => true, |
1173 | 1173 | 'title' => __( 'The license key is defined by your site\'s configuration file.', 'gravityview' ), |
1174 | 1174 | ) ); |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | |
1180 | 1180 | if ( \gravityview()->plugin->is_GF_25() ) { |
1181 | 1181 | |
1182 | - $sections[] = array( |
|
1182 | + $sections[ ] = array( |
|
1183 | 1183 | 'title' => __( 'GravityView License', 'gravityview' ), |
1184 | 1184 | 'class' => 'gform-settings-panel--full gv-settings-panel--license', |
1185 | 1185 | 'description' => $version_info, |
@@ -1197,7 +1197,7 @@ discard block |
||
1197 | 1197 | ) ); |
1198 | 1198 | } |
1199 | 1199 | |
1200 | - $sections[] = array( |
|
1200 | + $sections[ ] = array( |
|
1201 | 1201 | 'title' => ( gravityview()->plugin->is_GF_25() ? __( 'GravityView Settings', 'gravityview' ) : null ), |
1202 | 1202 | 'class' => 'gform-settings-panel--full gv-settings-panel--core', |
1203 | 1203 | 'fields' => $fields, |
@@ -1221,8 +1221,8 @@ discard block |
||
1221 | 1221 | |
1222 | 1222 | if ( $disabled_attribute ) { |
1223 | 1223 | foreach ( $extension_sections as &$section ) { |
1224 | - foreach ( $section['fields'] as &$field ) { |
|
1225 | - $field['disabled'] = $disabled_attribute; |
|
1224 | + foreach ( $section[ 'fields' ] as &$field ) { |
|
1225 | + $field[ 'disabled' ] = $disabled_attribute; |
|
1226 | 1226 | } |
1227 | 1227 | } |
1228 | 1228 | } |
@@ -1288,7 +1288,7 @@ discard block |
||
1288 | 1288 | public function settings_edd_license( $field, $echo = true ) { |
1289 | 1289 | |
1290 | 1290 | if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
1291 | - $field['input_type'] = 'password'; |
|
1291 | + $field[ 'input_type' ] = 'password'; |
|
1292 | 1292 | } |
1293 | 1293 | |
1294 | 1294 | $text = $this->settings_text( $field, false ); |
@@ -1340,7 +1340,7 @@ discard block |
||
1340 | 1340 | |
1341 | 1341 | ?> |
1342 | 1342 | |
1343 | - <tr id="gaddon-setting-row-<?php echo esc_attr( $field['name'] ); ?>"> |
|
1343 | + <tr id="gaddon-setting-row-<?php echo esc_attr( $field[ 'name' ] ); ?>"> |
|
1344 | 1344 | <td colspan="2"> |
1345 | 1345 | <?php $this->single_setting( $field ); ?> |
1346 | 1346 | </td> |
@@ -1366,8 +1366,8 @@ discard block |
||
1366 | 1366 | */ |
1367 | 1367 | public function single_setting_row( $field ) { |
1368 | 1368 | |
1369 | - $field['gv_description'] = Utils::get( $field, 'description' ); |
|
1370 | - $field['description'] = Utils::get( $field, 'subtitle' ); |
|
1369 | + $field[ 'gv_description' ] = Utils::get( $field, 'description' ); |
|
1370 | + $field[ 'description' ] = Utils::get( $field, 'subtitle' ); |
|
1371 | 1371 | parent::single_setting_row( $field ); |
1372 | 1372 | } |
1373 | 1373 | |
@@ -1428,8 +1428,8 @@ discard block |
||
1428 | 1428 | // then we assume it's changed. If it's changed, unset the status and the previous response. |
1429 | 1429 | if ( ! $added_message && ( $local_key !== $response_key ) ) { |
1430 | 1430 | |
1431 | - unset( $posted_settings['license_key_response'] ); |
|
1432 | - unset( $posted_settings['license_key_status'] ); |
|
1431 | + unset( $posted_settings[ 'license_key_response' ] ); |
|
1432 | + unset( $posted_settings[ 'license_key_status' ] ); |
|
1433 | 1433 | |
1434 | 1434 | \GFCommon::add_error_message( __( 'The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
1435 | 1435 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | function edit_entry_fix_hidden_fields( $fields ) { |
50 | 50 | |
51 | 51 | /** @type GF_Field $field */ |
52 | - foreach( $fields as &$field ) { |
|
52 | + foreach ( $fields as &$field ) { |
|
53 | 53 | |
54 | 54 | if ( 'hidden' === $field->type ) { |
55 | 55 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | $reveal_hidden_field = apply_filters( 'gravityview/edit_entry/reveal_hidden_field', false, $field ); |
64 | 64 | |
65 | - if( ! $reveal_hidden_field ) { |
|
65 | + if ( ! $reveal_hidden_field ) { |
|
66 | 66 | continue; |
67 | 67 | } |
68 | 68 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | public function edit_entry_fix_uid_fields( $fields ) { |
51 | 51 | |
52 | 52 | /** @type \GF_Field $field */ |
53 | - foreach( $fields as &$field ) { |
|
53 | + foreach ( $fields as &$field ) { |
|
54 | 54 | if ( 'uid' === $field->type ) { |
55 | 55 | |
56 | 56 | // Replace GF_Field with GF_Field_Text, copying all the data from $field |