@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | foreach ( $pass_settings as $setting ) { |
141 | 141 | if ( isset( $settings_list->$setting ) ) { |
142 | - $settings[ $setting ] = $this->maybe_json( $settings_list->$setting ); |
|
142 | + $settings[$setting] = $this->maybe_json( $settings_list->$setting ); |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | |
172 | 172 | $message_settings = array(); |
173 | 173 | foreach ( $messages as $message ) { |
174 | - $message_settings[ $message ] = $settings_list->$message; |
|
174 | + $message_settings[$message] = $settings_list->$message; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | return $message_settings; |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | |
190 | 190 | foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
191 | 191 | if ( isset( $settings_list->$frm_role ) ) { |
192 | - $permissions[ $frm_role ] = $settings_list->$frm_role; |
|
192 | + $permissions[$frm_role] = $settings_list->$frm_role; |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 | |
@@ -256,8 +256,8 @@ discard block |
||
256 | 256 | ); |
257 | 257 | |
258 | 258 | foreach ( $settings as $setting ) { |
259 | - if ( isset( $form->options[ $setting ] ) ) { |
|
260 | - $new_form[ $setting ] = $this->maybe_json( $form->options[ $setting ] ); |
|
259 | + if ( isset( $form->options[$setting] ) ) { |
|
260 | + $new_form[$setting] = $this->maybe_json( $form->options[$setting] ); |
|
261 | 261 | } |
262 | 262 | } |
263 | 263 | |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | * @return array |
309 | 309 | */ |
310 | 310 | private function fields() { |
311 | - $args = array( |
|
311 | + $args = array( |
|
312 | 312 | 'limit' => 50, |
313 | 313 | 'order_by' => 'id DESC', |
314 | 314 | ); |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | $fields = FrmDb::get_results( 'frm_fields', array(), 'form_id, name, type, field_options', $args ); |
317 | 317 | foreach ( $fields as $k => $field ) { |
318 | 318 | FrmAppHelper::unserialize_or_decode( $field->field_options ); |
319 | - $fields[ $k ]->field_options = json_encode( $field->field_options ); |
|
319 | + $fields[$k]->field_options = json_encode( $field->field_options ); |
|
320 | 320 | } |
321 | 321 | return $fields; |
322 | 322 | } |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | |
330 | 330 | foreach ( (array) $fields as $f ) { |
331 | 331 | FrmAppHelper::unserialize_or_decode( $f->field_options ); |
332 | - $size = $f->field_options['size']; |
|
332 | + $size = $f->field_options['size']; |
|
333 | 333 | $this->maybe_convert_migrated_size( $size ); |
334 | 334 | |
335 | 335 | if ( $size === $f->field_options['size'] ) { |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | continue; |
393 | 393 | } |
394 | 394 | |
395 | - $this->maybe_convert_migrated_size( $widgets[ $k ]['size'] ); |
|
395 | + $this->maybe_convert_migrated_size( $widgets[$k]['size'] ); |
|
396 | 396 | } |
397 | 397 | update_option( 'widget_frm_show_form', $widgets ); |
398 | 398 | } |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | if ( ! is_array( $widget ) || ! isset( $widget['size'] ) ) { |
492 | 492 | continue; |
493 | 493 | } |
494 | - $this->convert_character_to_px( $widgets[ $k ]['size'] ); |
|
494 | + $this->convert_character_to_px( $widgets[$k]['size'] ); |
|
495 | 495 | } |
496 | 496 | update_option( 'widget_frm_show_form', $widgets ); |
497 | 497 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | global $wpdb; |
56 | 56 | |
57 | - $values = array( |
|
57 | + $values = array( |
|
58 | 58 | 'item_id' => $entry_id, |
59 | 59 | 'field_id' => $field_id, |
60 | 60 | ); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | if ( ( is_array( $meta_value ) && empty( $meta_value ) ) || ( ! is_array( $meta_value ) && trim( $meta_value ) == '' ) ) { |
130 | 130 | // remove blank fields |
131 | - unset( $values[ $field_id ] ); |
|
131 | + unset( $values[$field_id] ); |
|
132 | 132 | } else { |
133 | 133 | // if value exists, then update it |
134 | 134 | self::update_entry_meta( $entry_id, $field_id, '', $meta_value ); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | */ |
194 | 194 | public static function get_meta_value( $entry, $field_id ) { |
195 | 195 | if ( isset( $entry->metas ) ) { |
196 | - return isset( $entry->metas[ $field_id ] ) ? $entry->metas[ $field_id ] : false; |
|
196 | + return isset( $entry->metas[$field_id] ) ? $entry->metas[$field_id] : false; |
|
197 | 197 | } else { |
198 | 198 | return self::get_entry_meta_by_field( $entry->id, $field_id ); |
199 | 199 | } |
@@ -211,8 +211,8 @@ discard block |
||
211 | 211 | $cached = FrmDb::check_cache( $entry_id, 'frm_entry' ); |
212 | 212 | } |
213 | 213 | |
214 | - if ( $cached && isset( $cached->metas ) && isset( $cached->metas[ $field_id ] ) ) { |
|
215 | - $result = $cached->metas[ $field_id ]; |
|
214 | + if ( $cached && isset( $cached->metas ) && isset( $cached->metas[$field_id] ) ) { |
|
215 | + $result = $cached->metas[$field_id]; |
|
216 | 216 | |
217 | 217 | return wp_unslash( $result ); |
218 | 218 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | if ( is_numeric( $field_id ) ) { |
223 | 223 | $query['field_id'] = $field_id; |
224 | 224 | } else { |
225 | - $get_table .= ' it LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_fields fi ON it.field_id=fi.id'; |
|
225 | + $get_table .= ' it LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_fields fi ON it.field_id=fi.id'; |
|
226 | 226 | $query['fi.field_key'] = $field_id; |
227 | 227 | } |
228 | 228 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | 'stripslashes' => true, |
241 | 241 | 'is_draft' => false, |
242 | 242 | ); |
243 | - $args = wp_parse_args( $args, $defaults ); |
|
243 | + $args = wp_parse_args( $args, $defaults ); |
|
244 | 244 | |
245 | 245 | $query = array(); |
246 | 246 | self::meta_field_query( $field_id, $order, $limit, $args, $query ); |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | |
256 | 256 | foreach ( $values as $k => $v ) { |
257 | 257 | FrmAppHelper::unserialize_or_decode( $v ); |
258 | - $values[ $k ] = $v; |
|
258 | + $values[$k] = $v; |
|
259 | 259 | unset( $k, $v ); |
260 | 260 | } |
261 | 261 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | |
313 | 313 | foreach ( $results as $k => $result ) { |
314 | 314 | FrmAppHelper::unserialize_or_decode( $result->meta_value ); |
315 | - $results[ $k ]->meta_value = wp_unslash( $result->meta_value ); |
|
315 | + $results[$k]->meta_value = wp_unslash( $result->meta_value ); |
|
316 | 316 | unset( $k, $result ); |
317 | 317 | } |
318 | 318 | |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | 'user_id' => '', |
326 | 326 | 'group_by' => '', |
327 | 327 | ); |
328 | - $args = wp_parse_args( $args, $defaults ); |
|
328 | + $args = wp_parse_args( $args, $defaults ); |
|
329 | 329 | |
330 | 330 | $query = array(); |
331 | 331 | self::get_ids_query( $where, $order_by, $limit, $unique, $args, $query ); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $to = $this->prepare_email_setting( $this->settings['email_to'], $user_id_args ); |
86 | 86 | $to = $this->explode_emails( $to ); |
87 | 87 | |
88 | - $where = array( |
|
88 | + $where = array( |
|
89 | 89 | 'it.field_id !' => 0, |
90 | 90 | 'it.item_id' => $this->entry->id, |
91 | 91 | ); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | 'entry' => $this->entry, |
96 | 96 | 'form' => $this->form, |
97 | 97 | ); |
98 | - $to = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args ); |
|
98 | + $to = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args ); |
|
99 | 99 | |
100 | 100 | $this->to = array_unique( (array) $to ); |
101 | 101 | |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | |
299 | 299 | // Add the user info if it isn't already included |
300 | 300 | if ( $this->include_user_info && $prev_mail_body === $mail_body ) { |
301 | - $data = $this->entry->description; |
|
301 | + $data = $this->entry->description; |
|
302 | 302 | $mail_body .= "\r\n\r\n" . __( 'User Information', 'formidable' ) . "\r\n"; |
303 | 303 | $this->maybe_add_ip( $mail_body ); |
304 | 304 | $mail_body .= __( 'User-Agent (Browser/OS)', 'formidable' ) . ': ' . FrmEntriesHelper::get_browser( $data['browser'] ) . "\r\n"; |
@@ -563,12 +563,12 @@ discard block |
||
563 | 563 | $name = trim( str_replace( $email, '', $val ) ); |
564 | 564 | } else { |
565 | 565 | // If user enters a name without an email |
566 | - unset( $recipients[ $key ] ); |
|
566 | + unset( $recipients[$key] ); |
|
567 | 567 | continue; |
568 | 568 | } |
569 | 569 | } |
570 | 570 | |
571 | - $recipients[ $key ] = $this->format_from_email( $name, $email ); |
|
571 | + $recipients[$key] = $this->format_from_email( $name, $email ); |
|
572 | 572 | } |
573 | 573 | |
574 | 574 | return $recipients; |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | ); |
710 | 710 | |
711 | 711 | // Remove phone number from to addresses |
712 | - unset( $this->to[ $key ] ); |
|
712 | + unset( $this->to[$key] ); |
|
713 | 713 | } |
714 | 714 | } |
715 | 715 | } |
@@ -65,19 +65,19 @@ discard block |
||
65 | 65 | global $frm_vars; |
66 | 66 | $form_id = FrmForm::get_current_form_id(); |
67 | 67 | |
68 | - $columns[ $form_id . '_id' ] = 'ID'; |
|
69 | - $columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' ); |
|
68 | + $columns[$form_id . '_id'] = 'ID'; |
|
69 | + $columns[$form_id . '_item_key'] = esc_html__( 'Entry Key', 'formidable' ); |
|
70 | 70 | |
71 | 71 | if ( $form_id ) { |
72 | 72 | self::get_columns_for_form( $form_id, $columns ); |
73 | 73 | } else { |
74 | - $columns[ $form_id . '_form_id' ] = __( 'Form', 'formidable' ); |
|
75 | - $columns[ $form_id . '_name' ] = __( 'Entry Name', 'formidable' ); |
|
76 | - $columns[ $form_id . '_user_id' ] = __( 'Created By', 'formidable' ); |
|
74 | + $columns[$form_id . '_form_id'] = __( 'Form', 'formidable' ); |
|
75 | + $columns[$form_id . '_name'] = __( 'Entry Name', 'formidable' ); |
|
76 | + $columns[$form_id . '_user_id'] = __( 'Created By', 'formidable' ); |
|
77 | 77 | } |
78 | 78 | |
79 | - $columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' ); |
|
80 | - $columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' ); |
|
79 | + $columns[$form_id . '_created_at'] = __( 'Entry creation date', 'formidable' ); |
|
80 | + $columns[$form_id . '_updated_at'] = __( 'Entry update date', 'formidable' ); |
|
81 | 81 | self::maybe_add_ip_col( $form_id, $columns ); |
82 | 82 | |
83 | 83 | $frm_vars['cols'] = $columns; |
@@ -125,10 +125,10 @@ discard block |
||
125 | 125 | |
126 | 126 | foreach ( $sub_form_cols as $k => $sub_form_col ) { |
127 | 127 | if ( FrmField::is_no_save_field( $sub_form_col->type ) ) { |
128 | - unset( $sub_form_cols[ $k ] ); |
|
128 | + unset( $sub_form_cols[$k] ); |
|
129 | 129 | continue; |
130 | 130 | } |
131 | - $columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
131 | + $columns[$form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
132 | 132 | unset( $sub_form_col ); |
133 | 133 | } |
134 | 134 | } |
@@ -145,15 +145,15 @@ discard block |
||
145 | 145 | $has_separate_value = ! FrmField::is_option_empty( $field, 'separate_value' ); |
146 | 146 | $is_post_status = FrmField::is_option_true( $field, 'post_field' ) && $field->field_options['post_field'] == 'post_status'; |
147 | 147 | if ( $has_separate_value && ! $is_post_status ) { |
148 | - $columns[ $form_id . '_frmsep_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 ); |
|
148 | + $columns[$form_id . '_frmsep_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 ); |
|
149 | 149 | } |
150 | 150 | |
151 | - $columns[ $form_id . '_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 ); |
|
151 | + $columns[$form_id . '_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 ); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | private static function maybe_add_ip_col( $form_id, &$columns ) { |
155 | 155 | if ( FrmAppHelper::ips_saved() ) { |
156 | - $columns[ $form_id . '_ip' ] = 'IP'; |
|
156 | + $columns[$form_id . '_ip'] = 'IP'; |
|
157 | 157 | } |
158 | 158 | } |
159 | 159 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | foreach ( $meta_value as $mk => $mv ) { |
192 | 192 | // Remove blank values. |
193 | 193 | if ( empty( $mv ) ) { |
194 | - unset( $meta_value[ $mk ] ); |
|
194 | + unset( $meta_value[$mk] ); |
|
195 | 195 | } |
196 | 196 | } |
197 | 197 | |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | foreach ( $fields as $field ) { |
269 | 269 | if ( $field->type != 'checkbox' && ( ! isset( $field->field_options['post_field'] ) || $field->field_options['post_field'] == '' ) ) { |
270 | 270 | // Can't sort on checkboxes because they are stored serialized, or post fields |
271 | - $columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id; |
|
271 | + $columns[$form_id . '_' . $field->field_key] = 'meta_' . $field->id; |
|
272 | 272 | } |
273 | 273 | } |
274 | 274 | |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | $atts['form_id'] . '_item_key' => '', |
333 | 333 | $atts['form_id'] . '_id' => '', |
334 | 334 | ); |
335 | - $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
335 | + $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
336 | 336 | |
337 | 337 | $i = $atts['i']; |
338 | 338 | |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | |
344 | 344 | if ( empty( $result ) || ! in_array( $col_key, $result, true ) ) { |
345 | 345 | $result[] = $col_key; |
346 | - $i--; |
|
346 | + $i --; |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | unset( $col_key, $col ); |
@@ -476,9 +476,9 @@ discard block |
||
476 | 476 | if ( ! isset( $frm_vars['form_params'] ) ) { |
477 | 477 | $frm_vars['form_params'] = array(); |
478 | 478 | } |
479 | - $frm_vars['form_params'][ $form->id ] = $params; |
|
479 | + $frm_vars['form_params'][$form->id] = $params; |
|
480 | 480 | |
481 | - if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) { |
|
481 | + if ( isset( $frm_vars['created_entries'][$form_id] ) ) { |
|
482 | 482 | return; |
483 | 483 | } |
484 | 484 | |
@@ -494,16 +494,16 @@ discard block |
||
494 | 494 | */ |
495 | 495 | $errors = apply_filters( 'frm_entries_before_create', $errors, $form ); |
496 | 496 | |
497 | - $frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors ); |
|
497 | + $frm_vars['created_entries'][$form_id] = array( 'errors' => $errors ); |
|
498 | 498 | |
499 | 499 | if ( empty( $errors ) ) { |
500 | 500 | $_POST['frm_skip_cookie'] = 1; |
501 | 501 | $do_success = false; |
502 | 502 | if ( $params['action'] == 'create' ) { |
503 | - if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) { |
|
504 | - $frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST ); |
|
503 | + if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) { |
|
504 | + $frm_vars['created_entries'][$form_id]['entry_id'] = FrmEntry::create( $_POST ); |
|
505 | 505 | |
506 | - $params['id'] = $frm_vars['created_entries'][ $form_id ]['entry_id']; |
|
506 | + $params['id'] = $frm_vars['created_entries'][$form_id]['entry_id']; |
|
507 | 507 | $do_success = true; |
508 | 508 | } |
509 | 509 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | protected function get_field_value( $args ) { |
50 | 50 | $user_ID = get_current_user_id(); |
51 | 51 | $user_ID = ( $user_ID ? $user_ID : '' ); |
52 | - $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][ $this->field['id'] ] ) ); // WPCS: CSRF ok. |
|
52 | + $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][$this->field['id']] ) ); // WPCS: CSRF ok. |
|
53 | 53 | $action = ( isset( $args['action'] ) ? $args['action'] : ( isset( $args['form_action'] ) ? $args['form_action'] : '' ) ); |
54 | 54 | $updating = $action == 'update'; |
55 | 55 | return ( is_numeric( $this->field['value'] ) || $posted_value || $updating ) ? $this->field['value'] : $user_ID; |
@@ -49,10 +49,10 @@ |
||
49 | 49 | foreach ( $pro_fields as $field_key => $field_type ) { |
50 | 50 | |
51 | 51 | if ( isset( $field_type['section'] ) ) { |
52 | - if ( ! isset( $field_sections[ $field_type['section'] ] ) ) { |
|
53 | - $field_sections[ $field_type['section'] ] = array(); |
|
52 | + if ( ! isset( $field_sections[$field_type['section']] ) ) { |
|
53 | + $field_sections[$field_type['section']] = array(); |
|
54 | 54 | } |
55 | - $field_sections[ $field_type['section'] ][ $field_key ] = $field_type; |
|
55 | + $field_sections[$field_type['section']][$field_key] = $field_type; |
|
56 | 56 | continue; |
57 | 57 | } |
58 | 58 |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $new_values['field_key'] = FrmAppHelper::get_unique_key( $key, $wpdb->prefix . 'frm_fields', 'field_key' ); |
218 | 218 | |
219 | 219 | foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) { |
220 | - $new_values[ $col ] = $values[ $col ]; |
|
220 | + $new_values[$col] = $values[$col]; |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | $new_values['options'] = $values['options']; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $new_values['created_at'] = current_time( 'mysql', 1 ); |
230 | 230 | |
231 | 231 | if ( isset( $values['id'] ) ) { |
232 | - $frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key']; |
|
232 | + $frm_duplicate_ids[$values['field_key']] = $new_values['field_key']; |
|
233 | 233 | $new_values = apply_filters( 'frm_duplicated_field', $new_values ); |
234 | 234 | } |
235 | 235 | |
@@ -238,9 +238,9 @@ discard block |
||
238 | 238 | foreach ( $new_values as $k => $v ) { |
239 | 239 | if ( is_array( $v ) ) { |
240 | 240 | if ( $k === 'default_value' ) { |
241 | - $new_values[ $k ] = FrmAppHelper::maybe_json_encode( $v ); |
|
241 | + $new_values[$k] = FrmAppHelper::maybe_json_encode( $v ); |
|
242 | 242 | } else { |
243 | - $new_values[ $k ] = serialize( $v ); |
|
243 | + $new_values[$k] = serialize( $v ); |
|
244 | 244 | } |
245 | 245 | } |
246 | 246 | unset( $k, $v ); |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | |
263 | 263 | if ( $query_results ) { |
264 | 264 | if ( isset( $values['id'] ) ) { |
265 | - $frm_duplicate_ids[ $values['id'] ] = $new_id; |
|
265 | + $frm_duplicate_ids[$values['id']] = $new_id; |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | return $new_id; |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) { |
275 | 275 | global $frm_duplicate_ids; |
276 | 276 | |
277 | - $where = array( |
|
277 | + $where = array( |
|
278 | 278 | array( |
279 | 279 | 'or' => 1, |
280 | 280 | 'fi.form_id' => $old_form_id, |
@@ -320,8 +320,8 @@ discard block |
||
320 | 320 | |
321 | 321 | $values = apply_filters( 'frm_duplicated_field', $values ); |
322 | 322 | $new_id = self::create( $values ); |
323 | - $frm_duplicate_ids[ $field->id ] = $new_id; |
|
324 | - $frm_duplicate_ids[ $field->field_key ] = $new_id; |
|
323 | + $frm_duplicate_ids[$field->id] = $new_id; |
|
324 | + $frm_duplicate_ids[$field->field_key] = $new_id; |
|
325 | 325 | unset( $field ); |
326 | 326 | } |
327 | 327 | } |
@@ -352,8 +352,8 @@ discard block |
||
352 | 352 | |
353 | 353 | // serialize array values |
354 | 354 | foreach ( array( 'field_options', 'options' ) as $opt ) { |
355 | - if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) { |
|
356 | - $values[ $opt ] = serialize( $values[ $opt ] ); |
|
355 | + if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) { |
|
356 | + $values[$opt] = serialize( $values[$opt] ); |
|
357 | 357 | } |
358 | 358 | } |
359 | 359 | if ( isset( $values['default_value'] ) && is_array( $values['default_value'] ) ) { |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | 'id' => $id, |
506 | 506 | 'field_key' => $id, |
507 | 507 | ); |
508 | - $type = FrmDb::get_var( 'frm_fields', $where, $col ); |
|
508 | + $type = FrmDb::get_var( 'frm_fields', $where, $col ); |
|
509 | 509 | } |
510 | 510 | |
511 | 511 | return $type; |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | continue; |
532 | 532 | } |
533 | 533 | |
534 | - $fields[ $result->id ] = $result; |
|
534 | + $fields[$result->id] = $result; |
|
535 | 535 | $count ++; |
536 | 536 | if ( $limit == 1 ) { |
537 | 537 | $fields = $result; |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | $count = 0; |
578 | 578 | foreach ( $results as $result ) { |
579 | 579 | $count ++; |
580 | - $fields[ $result->id ] = $result; |
|
580 | + $fields[$result->id] = $result; |
|
581 | 581 | if ( ! empty( $limit ) && $count >= $limit ) { |
582 | 582 | break; |
583 | 583 | } |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | } |
647 | 647 | |
648 | 648 | if ( ! empty( $sub_fields ) ) { |
649 | - $index = $k + $index_offset; |
|
649 | + $index = $k + $index_offset; |
|
650 | 650 | $index_offset += count( $sub_fields ); |
651 | 651 | array_splice( $results, $index, 0, $sub_fields ); |
652 | 652 | } |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | $query_type = ( $limit == ' LIMIT 1' || $limit == 1 ) ? 'row' : 'results'; |
692 | 692 | |
693 | 693 | if ( is_array( $where ) ) { |
694 | - $args = array( |
|
694 | + $args = array( |
|
695 | 695 | 'order_by' => $order_by, |
696 | 696 | 'limit' => $limit, |
697 | 697 | ); |
@@ -722,9 +722,9 @@ discard block |
||
722 | 722 | FrmDb::set_cache( $result->field_key, $result, 'frm_field' ); |
723 | 723 | |
724 | 724 | self::prepare_options( $result ); |
725 | - $results[ $r_key ]->field_options = $result->field_options; |
|
726 | - $results[ $r_key ]->options = $result->options; |
|
727 | - $results[ $r_key ]->default_value = $result->default_value; |
|
725 | + $results[$r_key]->field_options = $result->field_options; |
|
726 | + $results[$r_key]->options = $result->options; |
|
727 | + $results[$r_key]->default_value = $result->default_value; |
|
728 | 728 | |
729 | 729 | unset( $r_key, $result ); |
730 | 730 | } |
@@ -926,23 +926,23 @@ discard block |
||
926 | 926 | } |
927 | 927 | |
928 | 928 | public static function is_option_true_in_array( $field, $option ) { |
929 | - return isset( $field[ $option ] ) && $field[ $option ]; |
|
929 | + return isset( $field[$option] ) && $field[$option]; |
|
930 | 930 | } |
931 | 931 | |
932 | 932 | public static function is_option_true_in_object( $field, $option ) { |
933 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ]; |
|
933 | + return isset( $field->field_options[$option] ) && $field->field_options[$option]; |
|
934 | 934 | } |
935 | 935 | |
936 | 936 | public static function is_option_empty_in_array( $field, $option ) { |
937 | - return ! isset( $field[ $option ] ) || empty( $field[ $option ] ); |
|
937 | + return ! isset( $field[$option] ) || empty( $field[$option] ); |
|
938 | 938 | } |
939 | 939 | |
940 | 940 | public static function is_option_empty_in_object( $field, $option ) { |
941 | - return ! isset( $field->field_options[ $option ] ) || empty( $field->field_options[ $option ] ); |
|
941 | + return ! isset( $field->field_options[$option] ) || empty( $field->field_options[$option] ); |
|
942 | 942 | } |
943 | 943 | |
944 | 944 | public static function is_option_value_in_object( $field, $option ) { |
945 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != ''; |
|
945 | + return isset( $field->field_options[$option] ) && $field->field_options[$option] != ''; |
|
946 | 946 | } |
947 | 947 | |
948 | 948 | /** |
@@ -960,10 +960,10 @@ discard block |
||
960 | 960 | |
961 | 961 | public static function get_option_in_array( $field, $option ) { |
962 | 962 | |
963 | - if ( isset( $field[ $option ] ) ) { |
|
964 | - $this_option = $field[ $option ]; |
|
965 | - } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) { |
|
966 | - $this_option = $field['field_options'][ $option ]; |
|
963 | + if ( isset( $field[$option] ) ) { |
|
964 | + $this_option = $field[$option]; |
|
965 | + } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) { |
|
966 | + $this_option = $field['field_options'][$option]; |
|
967 | 967 | } else { |
968 | 968 | $this_option = ''; |
969 | 969 | } |
@@ -972,7 +972,7 @@ discard block |
||
972 | 972 | } |
973 | 973 | |
974 | 974 | public static function get_option_in_object( $field, $option ) { |
975 | - return isset( $field->field_options[ $option ] ) ? $field->field_options[ $option ] : ''; |
|
975 | + return isset( $field->field_options[$option] ) ? $field->field_options[$option] : ''; |
|
976 | 976 | } |
977 | 977 | |
978 | 978 | /** |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | protected function create_fields( $form_id, &$form ) { |
397 | 397 | foreach ( $form['fields'] as $key => $new_field ) { |
398 | 398 | $new_field['form_id'] = $form_id; |
399 | - $form['fields'][ $key ]['id'] = FrmField::create( $new_field ); |
|
399 | + $form['fields'][$key]['id'] = FrmField::create( $new_field ); |
|
400 | 400 | } |
401 | 401 | } |
402 | 402 | |
@@ -426,9 +426,9 @@ discard block |
||
426 | 426 | } elseif ( $key === 'the_post_title' ) { |
427 | 427 | $new_action->post_content['post_title'] = $value; |
428 | 428 | } elseif ( is_string( $value ) ) { |
429 | - $new_action->post_content[ $key ] = $this->replace_smart_tags( $value, $form['fields'] ); |
|
429 | + $new_action->post_content[$key] = $this->replace_smart_tags( $value, $form['fields'] ); |
|
430 | 430 | } else { |
431 | - $new_action->post_content[ $key ] = $value; |
|
431 | + $new_action->post_content[$key] = $value; |
|
432 | 432 | } |
433 | 433 | } |
434 | 434 | |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | |
448 | 448 | $imported = $this->get_tracked_import(); |
449 | 449 | |
450 | - $imported[ $this->slug ][ $new_form_id ] = $source_id; |
|
450 | + $imported[$this->slug][$new_form_id] = $source_id; |
|
451 | 451 | |
452 | 452 | update_option( $this->tracking, $imported, false ); |
453 | 453 | } |
@@ -467,11 +467,11 @@ discard block |
||
467 | 467 | private function is_imported( $source_id ) { |
468 | 468 | $imported = $this->get_tracked_import(); |
469 | 469 | $new_form_id = 0; |
470 | - if ( ! isset( $imported[ $this->slug ] ) || ! in_array( $source_id, $imported[ $this->slug ] ) ) { |
|
470 | + if ( ! isset( $imported[$this->slug] ) || ! in_array( $source_id, $imported[$this->slug] ) ) { |
|
471 | 471 | return $new_form_id; |
472 | 472 | } |
473 | 473 | |
474 | - $new_form_id = array_search( $source_id, array_reverse( $imported[ $this->slug ], true ) ); |
|
474 | + $new_form_id = array_search( $source_id, array_reverse( $imported[$this->slug], true ) ); |
|
475 | 475 | if ( ! empty( $new_form_id ) && empty( FrmForm::get_key_by_id( $new_form_id ) ) ) { |
476 | 476 | // Allow reimport if the form was deleted. |
477 | 477 | $new_form_id = 0; |