@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined('ABSPATH') ) { |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | 3 | die( 'You are not allowed to call this page directly.' ); |
4 | 4 | } |
5 | 5 | |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | unset( $check_val['is_draft'], $check_val['id'], $check_val['item_key'] ); |
56 | 56 | |
57 | 57 | if ( $new_values['item_key'] == $new_values['name'] ) { |
58 | - unset($check_val['name']); |
|
58 | + unset( $check_val['name'] ); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | global $wpdb; |
62 | 62 | $entry_exists = FrmDb::get_col( $wpdb->prefix . 'frm_items', $check_val, 'id', array( 'order_by' => 'created_at DESC' ) ); |
63 | 63 | |
64 | - if ( ! $entry_exists || empty($entry_exists) || ! isset($values['item_meta']) ) { |
|
64 | + if ( ! $entry_exists || empty( $entry_exists ) || ! isset( $values['item_meta'] ) ) { |
|
65 | 65 | return false; |
66 | 66 | } |
67 | 67 | |
@@ -70,10 +70,10 @@ discard block |
||
70 | 70 | $is_duplicate = true; |
71 | 71 | |
72 | 72 | //add more checks here to make sure it's a duplicate |
73 | - $metas = FrmEntryMeta::get_entry_meta_info($entry_exist); |
|
73 | + $metas = FrmEntryMeta::get_entry_meta_info( $entry_exist ); |
|
74 | 74 | $field_metas = array(); |
75 | 75 | foreach ( $metas as $meta ) { |
76 | - $field_metas[ $meta->field_id ] = $meta->meta_value; |
|
76 | + $field_metas[$meta->field_id] = $meta->meta_value; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | // If prev entry is empty and current entry is not, they are not duplicates |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | return false; |
83 | 83 | } |
84 | 84 | |
85 | - $diff = array_diff_assoc($field_metas, array_map('maybe_serialize', $values['item_meta'])); |
|
85 | + $diff = array_diff_assoc( $field_metas, array_map( 'maybe_serialize', $values['item_meta'] ) ); |
|
86 | 86 | foreach ( $diff as $field_id => $meta_value ) { |
87 | - if ( ! empty($meta_value) ) { |
|
87 | + if ( ! empty( $meta_value ) ) { |
|
88 | 88 | $is_duplicate = false; |
89 | 89 | continue; |
90 | 90 | } |
@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | * @param int $duplicate_entry_time |
107 | 107 | * @return bool |
108 | 108 | */ |
109 | - private static function is_duplicate_check_needed( $values, $duplicate_entry_time ){ |
|
109 | + private static function is_duplicate_check_needed( $values, $duplicate_entry_time ) { |
|
110 | 110 | // If time for checking duplicates is set to an empty value, don't check for duplicates |
111 | 111 | if ( empty( $duplicate_entry_time ) ) { |
112 | 112 | return false; |
113 | 113 | } |
114 | 114 | |
115 | 115 | // If CSV is importing, don't check for duplicates |
116 | - if ( defined('WP_IMPORTING') && WP_IMPORTING ) { |
|
116 | + if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { |
|
117 | 117 | return false; |
118 | 118 | } |
119 | 119 | |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | $new_values['name'] = $values->name; |
136 | 136 | $new_values['is_draft'] = $values->is_draft; |
137 | 137 | $new_values['user_id'] = $new_values['updated_by'] = (int) $values->user_id; |
138 | - $new_values['form_id'] = $values->form_id ? (int) $values->form_id: null; |
|
139 | - $new_values['created_at'] = $new_values['updated_at'] = current_time('mysql', 1); |
|
138 | + $new_values['form_id'] = $values->form_id ? (int) $values->form_id : null; |
|
139 | + $new_values['created_at'] = $new_values['updated_at'] = current_time( 'mysql', 1 ); |
|
140 | 140 | |
141 | 141 | $query_results = $wpdb->insert( $wpdb->prefix . 'frm_items', $new_values ); |
142 | 142 | if ( ! $query_results ) { |
@@ -146,12 +146,12 @@ discard block |
||
146 | 146 | $entry_id = $wpdb->insert_id; |
147 | 147 | |
148 | 148 | global $frm_vars; |
149 | - if ( ! isset($frm_vars['saved_entries']) ) { |
|
149 | + if ( ! isset( $frm_vars['saved_entries'] ) ) { |
|
150 | 150 | $frm_vars['saved_entries'] = array(); |
151 | 151 | } |
152 | 152 | $frm_vars['saved_entries'][] = (int) $entry_id; |
153 | 153 | |
154 | - FrmEntryMeta::duplicate_entry_metas($id, $entry_id); |
|
154 | + FrmEntryMeta::duplicate_entry_metas( $id, $entry_id ); |
|
155 | 155 | self::clear_cache(); |
156 | 156 | |
157 | 157 | do_action( 'frm_after_duplicate_entry', $entry_id, $new_values['form_id'], array( 'old_id' => $id ) ); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | |
191 | 191 | $new_values = self::package_entry_to_update( $id, $values ); |
192 | 192 | |
193 | - $query_results = $wpdb->update( $wpdb->prefix . 'frm_items', $new_values, compact('id') ); |
|
193 | + $query_results = $wpdb->update( $wpdb->prefix . 'frm_items', $new_values, compact( 'id' ) ); |
|
194 | 194 | |
195 | 195 | self::after_update_entry( $query_results, $id, $values, $new_values ); |
196 | 196 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | return $result; |
208 | 208 | } |
209 | 209 | |
210 | - do_action('frm_before_destroy_entry', $id, $entry); |
|
210 | + do_action( 'frm_before_destroy_entry', $id, $entry ); |
|
211 | 211 | |
212 | 212 | $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->prefix . 'frm_item_metas WHERE item_id=%d', $id ) ); |
213 | 213 | $result = $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->prefix . 'frm_items WHERE id=%d', $id ) ); |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | |
220 | 220 | public static function &update_form( $id, $value, $form_id ) { |
221 | 221 | global $wpdb; |
222 | - $form_id = isset($value) ? $form_id : null; |
|
222 | + $form_id = isset( $value ) ? $form_id : null; |
|
223 | 223 | $result = $wpdb->update( $wpdb->prefix . 'frm_items', array( 'form_id' => $form_id ), array( 'id' => $id ) ); |
224 | 224 | if ( $result ) { |
225 | 225 | self::clear_cache(); |
@@ -266,24 +266,24 @@ discard block |
||
266 | 266 | $query = "SELECT it.*, fr.name as form_name, fr.form_key as form_key FROM {$wpdb->prefix}frm_items it |
267 | 267 | LEFT OUTER JOIN {$wpdb->prefix}frm_forms fr ON it.form_id=fr.id WHERE "; |
268 | 268 | |
269 | - $query .= is_numeric($id) ? 'it.id=%d' : 'it.item_key=%s'; |
|
269 | + $query .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s'; |
|
270 | 270 | $query_args = array( $id ); |
271 | 271 | $query = $wpdb->prepare( $query, $query_args ); |
272 | 272 | |
273 | 273 | if ( ! $meta ) { |
274 | 274 | $entry = FrmAppHelper::check_cache( $id . '_nometa', 'frm_entry', $query, 'get_row' ); |
275 | - return stripslashes_deep($entry); |
|
275 | + return stripslashes_deep( $entry ); |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | $entry = FrmAppHelper::check_cache( $id, 'frm_entry' ); |
279 | 279 | if ( $entry !== false ) { |
280 | - return stripslashes_deep($entry); |
|
280 | + return stripslashes_deep( $entry ); |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | $entry = $wpdb->get_row( $query ); |
284 | - $entry = self::get_meta($entry); |
|
284 | + $entry = self::get_meta( $entry ); |
|
285 | 285 | |
286 | - return stripslashes_deep($entry); |
|
286 | + return stripslashes_deep( $entry ); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | public static function get_meta( $entry ) { |
@@ -299,25 +299,25 @@ discard block |
||
299 | 299 | $include_key = apply_filters( 'frm_include_meta_keys', false ); |
300 | 300 | foreach ( $metas as $meta_val ) { |
301 | 301 | if ( $meta_val->item_id == $entry->id ) { |
302 | - $entry->metas[ $meta_val->field_id ] = maybe_unserialize( $meta_val->meta_value ); |
|
302 | + $entry->metas[$meta_val->field_id] = maybe_unserialize( $meta_val->meta_value ); |
|
303 | 303 | if ( $include_key ) { |
304 | - $entry->metas[ $meta_val->field_key ] = $entry->metas[ $meta_val->field_id ]; |
|
304 | + $entry->metas[$meta_val->field_key] = $entry->metas[$meta_val->field_id]; |
|
305 | 305 | } |
306 | 306 | continue; |
307 | 307 | } |
308 | 308 | |
309 | 309 | // include sub entries in an array |
310 | - if ( ! isset( $entry_metas[ $meta_val->field_id ] ) ) { |
|
311 | - $entry->metas[ $meta_val->field_id ] = array(); |
|
310 | + if ( ! isset( $entry_metas[$meta_val->field_id] ) ) { |
|
311 | + $entry->metas[$meta_val->field_id] = array(); |
|
312 | 312 | } |
313 | 313 | |
314 | - $entry->metas[ $meta_val->field_id ][] = maybe_unserialize( $meta_val->meta_value ); |
|
314 | + $entry->metas[$meta_val->field_id][] = maybe_unserialize( $meta_val->meta_value ); |
|
315 | 315 | |
316 | - unset($meta_val); |
|
316 | + unset( $meta_val ); |
|
317 | 317 | } |
318 | - unset($metas); |
|
318 | + unset( $metas ); |
|
319 | 319 | |
320 | - wp_cache_set( $entry->id, $entry, 'frm_entry'); |
|
320 | + wp_cache_set( $entry->id, $entry, 'frm_entry' ); |
|
321 | 321 | |
322 | 322 | return $entry; |
323 | 323 | } |
@@ -333,24 +333,24 @@ discard block |
||
333 | 333 | return $exists; |
334 | 334 | } |
335 | 335 | |
336 | - if ( is_numeric($id) ) { |
|
336 | + if ( is_numeric( $id ) ) { |
|
337 | 337 | $where = array( 'id' => $id ); |
338 | 338 | } else { |
339 | 339 | $where = array( 'item_key' => $id ); |
340 | 340 | } |
341 | 341 | $id = FrmDb::get_var( $wpdb->prefix . 'frm_items', $where ); |
342 | 342 | |
343 | - $exists = ($id && $id > 0) ? true : false; |
|
343 | + $exists = ( $id && $id > 0 ) ? true : false; |
|
344 | 344 | return $exists; |
345 | 345 | } |
346 | 346 | |
347 | 347 | public static function getAll( $where, $order_by = '', $limit = '', $meta = false, $inc_form = true ) { |
348 | 348 | global $wpdb; |
349 | 349 | |
350 | - $limit = FrmAppHelper::esc_limit($limit); |
|
350 | + $limit = FrmAppHelper::esc_limit( $limit ); |
|
351 | 351 | |
352 | - $cache_key = maybe_serialize($where) . $order_by . $limit . $inc_form; |
|
353 | - $entries = wp_cache_get($cache_key, 'frm_entry'); |
|
352 | + $cache_key = maybe_serialize( $where ) . $order_by . $limit . $inc_form; |
|
353 | + $entries = wp_cache_get( $cache_key, 'frm_entry' ); |
|
354 | 354 | |
355 | 355 | if ( false === $entries ) { |
356 | 356 | $fields = 'it.id, it.item_key, it.name, it.ip, it.form_id, it.post_id, it.user_id, it.parent_item_id, it.updated_by, it.created_at, it.updated_at, it.is_draft'; |
@@ -369,10 +369,10 @@ discard block |
||
369 | 369 | } |
370 | 370 | |
371 | 371 | // prepare the query |
372 | - $query = 'SELECT ' . $fields . ' FROM ' . $table . FrmAppHelper::prepend_and_or_where(' WHERE ', $where) . $order_by . $limit; |
|
372 | + $query = 'SELECT ' . $fields . ' FROM ' . $table . FrmAppHelper::prepend_and_or_where( ' WHERE ', $where ) . $order_by . $limit; |
|
373 | 373 | |
374 | - $entries = $wpdb->get_results($query, OBJECT_K); |
|
375 | - unset($query); |
|
374 | + $entries = $wpdb->get_results( $query, OBJECT_K ); |
|
375 | + unset( $query ); |
|
376 | 376 | |
377 | 377 | if ( ! FrmAppHelper::prevent_caching() ) { |
378 | 378 | wp_cache_set( $cache_key, $entries, 'frm_entry', 300 ); |
@@ -380,16 +380,16 @@ discard block |
||
380 | 380 | } |
381 | 381 | |
382 | 382 | if ( ! $meta || ! $entries ) { |
383 | - return stripslashes_deep($entries); |
|
383 | + return stripslashes_deep( $entries ); |
|
384 | 384 | } |
385 | - unset($meta); |
|
385 | + unset( $meta ); |
|
386 | 386 | |
387 | - if ( ! is_array( $where ) && preg_match('/^it\.form_id=\d+$/', $where) ) { |
|
387 | + if ( ! is_array( $where ) && preg_match( '/^it\.form_id=\d+$/', $where ) ) { |
|
388 | 388 | $where = array( 'it.form_id' => substr( $where, 11 ) ); |
389 | 389 | } |
390 | 390 | |
391 | 391 | $meta_where = array( 'field_id !' => 0 ); |
392 | - if ( $limit == '' && is_array($where) && count($where) == 1 && isset($where['it.form_id']) ) { |
|
392 | + if ( $limit == '' && is_array( $where ) && count( $where ) == 1 && isset( $where['it.form_id'] ) ) { |
|
393 | 393 | $meta_where['fi.form_id'] = $where['it.form_id']; |
394 | 394 | } else { |
395 | 395 | $meta_where['item_id'] = array_keys( $entries ); |
@@ -400,21 +400,21 @@ discard block |
||
400 | 400 | unset( $meta_where ); |
401 | 401 | |
402 | 402 | if ( ! $metas ) { |
403 | - return stripslashes_deep($entries); |
|
403 | + return stripslashes_deep( $entries ); |
|
404 | 404 | } |
405 | 405 | |
406 | 406 | foreach ( $metas as $m_key => $meta_val ) { |
407 | - if ( ! isset( $entries[ $meta_val->item_id ] ) ) { |
|
407 | + if ( ! isset( $entries[$meta_val->item_id] ) ) { |
|
408 | 408 | continue; |
409 | 409 | } |
410 | 410 | |
411 | - if ( ! isset( $entries[ $meta_val->item_id ]->metas ) ) { |
|
412 | - $entries[ $meta_val->item_id ]->metas = array(); |
|
411 | + if ( ! isset( $entries[$meta_val->item_id]->metas ) ) { |
|
412 | + $entries[$meta_val->item_id]->metas = array(); |
|
413 | 413 | } |
414 | 414 | |
415 | - $entries[ $meta_val->item_id ]->metas[ $meta_val->field_id ] = maybe_unserialize( $meta_val->meta_value ); |
|
415 | + $entries[$meta_val->item_id]->metas[$meta_val->field_id] = maybe_unserialize( $meta_val->meta_value ); |
|
416 | 416 | |
417 | - unset($m_key, $meta_val); |
|
417 | + unset( $m_key, $meta_val ); |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | if ( ! FrmAppHelper::prevent_caching() ) { |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | } |
425 | 425 | } |
426 | 426 | |
427 | - return stripslashes_deep($entries); |
|
427 | + return stripslashes_deep( $entries ); |
|
428 | 428 | } |
429 | 429 | |
430 | 430 | // Pagination Methods |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | global $wpdb; |
433 | 433 | $table_join = $wpdb->prefix . 'frm_items it LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id'; |
434 | 434 | |
435 | - if ( is_numeric($where) ) { |
|
435 | + if ( is_numeric( $where ) ) { |
|
436 | 436 | $table_join = 'frm_items'; |
437 | 437 | $where = array( 'form_id' => $where ); |
438 | 438 | } |
@@ -449,10 +449,10 @@ discard block |
||
449 | 449 | } |
450 | 450 | |
451 | 451 | public static function getPageCount( $p_size, $where = '' ) { |
452 | - if ( is_numeric($where) ) { |
|
452 | + if ( is_numeric( $where ) ) { |
|
453 | 453 | return ceil( (int) $where / (int) $p_size ); |
454 | 454 | } else { |
455 | - return ceil( (int) self::getRecordCount($where) / (int) $p_size ); |
|
455 | + return ceil( (int) self::getRecordCount( $where ) / (int) $p_size ); |
|
456 | 456 | } |
457 | 457 | } |
458 | 458 | |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | self::sanitize_entry_post( $values ); |
470 | 470 | |
471 | 471 | if ( $type != 'xml' ) { |
472 | - $values = apply_filters('frm_pre_create_entry', $values); |
|
472 | + $values = apply_filters( 'frm_pre_create_entry', $values ); |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | $new_values = self::package_entry_data( $values ); |
@@ -549,11 +549,11 @@ discard block |
||
549 | 549 | 'user_id' => self::get_entry_user_id( $values ), |
550 | 550 | ); |
551 | 551 | |
552 | - if ( is_array($new_values['name']) ) { |
|
553 | - $new_values['name'] = reset($new_values['name']); |
|
552 | + if ( is_array( $new_values['name'] ) ) { |
|
553 | + $new_values['name'] = reset( $new_values['name'] ); |
|
554 | 554 | } |
555 | 555 | |
556 | - $new_values['updated_by'] = isset($values['updated_by']) ? $values['updated_by'] : $new_values['user_id']; |
|
556 | + $new_values['updated_by'] = isset( $values['updated_by'] ) ? $values['updated_by'] : $new_values['user_id']; |
|
557 | 557 | |
558 | 558 | return $new_values; |
559 | 559 | } |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | * @return int |
567 | 567 | */ |
568 | 568 | private static function get_is_draft_value( $values ) { |
569 | - return ( ( isset( $values['frm_saving_draft'] ) && $values['frm_saving_draft'] == 1 ) || ( isset( $values['is_draft'] ) && $values['is_draft'] == 1 ) ) ? 1 : 0; |
|
569 | + return ( ( isset( $values['frm_saving_draft'] ) && $values['frm_saving_draft'] == 1 ) || ( isset( $values['is_draft'] ) && $values['is_draft'] == 1 ) ) ? 1 : 0; |
|
570 | 570 | } |
571 | 571 | |
572 | 572 | /** |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | * @return int |
589 | 589 | */ |
590 | 590 | private static function get_post_id( $values ) { |
591 | - return isset( $values['post_id'] ) ? (int) $values['post_id']: 0; |
|
591 | + return isset( $values['post_id'] ) ? (int) $values['post_id'] : 0; |
|
592 | 592 | } |
593 | 593 | |
594 | 594 | /** |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | * @return int |
600 | 600 | */ |
601 | 601 | private static function get_parent_item_id( $values ) { |
602 | - return isset( $values['parent_item_id'] ) ? (int) $values['parent_item_id']: 0; |
|
602 | + return isset( $values['parent_item_id'] ) ? (int) $values['parent_item_id'] : 0; |
|
603 | 603 | } |
604 | 604 | |
605 | 605 | /** |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | * @return string |
611 | 611 | */ |
612 | 612 | private static function get_created_at( $values ) { |
613 | - return isset( $values['created_at'] ) ? $values['created_at']: current_time('mysql', 1); |
|
613 | + return isset( $values['created_at'] ) ? $values['created_at'] : current_time( 'mysql', 1 ); |
|
614 | 614 | } |
615 | 615 | |
616 | 616 | /** |
@@ -698,7 +698,7 @@ discard block |
||
698 | 698 | private static function add_new_entry_to_frm_vars( $entry_id ) { |
699 | 699 | global $frm_vars; |
700 | 700 | |
701 | - if ( ! isset($frm_vars['saved_entries']) ) { |
|
701 | + if ( ! isset( $frm_vars['saved_entries'] ) ) { |
|
702 | 702 | $frm_vars['saved_entries'] = array(); |
703 | 703 | } |
704 | 704 | |
@@ -713,7 +713,7 @@ discard block |
||
713 | 713 | * @param int $entry_id |
714 | 714 | */ |
715 | 715 | private static function maybe_add_entry_metas( $values, $entry_id ) { |
716 | - if ( isset($values['item_meta']) ) { |
|
716 | + if ( isset( $values['item_meta'] ) ) { |
|
717 | 717 | FrmEntryMeta::update_entry_metas( $entry_id, $values['item_meta'] ); |
718 | 718 | } |
719 | 719 | } |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | $is_child = isset( $values['parent_form_id'] ) && isset( $values['parent_nonce'] ) && ! empty( $values['parent_form_id'] ) && wp_verify_nonce( $values['parent_nonce'], 'parent' ); |
731 | 731 | |
732 | 732 | do_action( 'frm_after_create_entry', $entry_id, $new_values['form_id'], compact( 'is_child' ) ); |
733 | - do_action( 'frm_after_create_entry_' . $new_values['form_id'], $entry_id , compact( 'is_child' ) ); |
|
733 | + do_action( 'frm_after_create_entry_' . $new_values['form_id'], $entry_id, compact( 'is_child' ) ); |
|
734 | 734 | } |
735 | 735 | |
736 | 736 | /** |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | } |
772 | 772 | |
773 | 773 | if ( $update && $update_type != 'xml' ) { |
774 | - $values = apply_filters('frm_pre_update_entry', $values, $id); |
|
774 | + $values = apply_filters( 'frm_pre_update_entry', $values, $id ); |
|
775 | 775 | } |
776 | 776 | |
777 | 777 | return $update; |
@@ -792,27 +792,27 @@ discard block |
||
792 | 792 | 'name' => self::get_new_entry_name( $values ), |
793 | 793 | 'form_id' => self::get_form_id( $values ), |
794 | 794 | 'is_draft' => self::get_is_draft_value( $values ), |
795 | - 'updated_at' => current_time('mysql', 1), |
|
796 | - 'updated_by' => isset($values['updated_by']) ? $values['updated_by'] : get_current_user_id(), |
|
795 | + 'updated_at' => current_time( 'mysql', 1 ), |
|
796 | + 'updated_by' => isset( $values['updated_by'] ) ? $values['updated_by'] : get_current_user_id(), |
|
797 | 797 | ); |
798 | 798 | |
799 | - if ( isset($values['post_id']) ) { |
|
799 | + if ( isset( $values['post_id'] ) ) { |
|
800 | 800 | $new_values['post_id'] = (int) $values['post_id']; |
801 | 801 | } |
802 | 802 | |
803 | - if ( isset($values['item_key']) ) { |
|
803 | + if ( isset( $values['item_key'] ) ) { |
|
804 | 804 | $new_values['item_key'] = FrmAppHelper::get_unique_key( $values['item_key'], $wpdb->prefix . 'frm_items', 'item_key', $id ); |
805 | 805 | } |
806 | 806 | |
807 | - if ( isset($values['parent_item_id']) ) { |
|
807 | + if ( isset( $values['parent_item_id'] ) ) { |
|
808 | 808 | $new_values['parent_item_id'] = (int) $values['parent_item_id']; |
809 | 809 | } |
810 | 810 | |
811 | - if ( isset($values['frm_user_id']) && is_numeric($values['frm_user_id']) ) { |
|
811 | + if ( isset( $values['frm_user_id'] ) && is_numeric( $values['frm_user_id'] ) ) { |
|
812 | 812 | $new_values['user_id'] = $values['frm_user_id']; |
813 | 813 | } |
814 | 814 | |
815 | - $new_values = apply_filters('frm_update_entry', $new_values, $id); |
|
815 | + $new_values = apply_filters( 'frm_update_entry', $new_values, $id ); |
|
816 | 816 | |
817 | 817 | return $new_values; |
818 | 818 | } |
@@ -106,7 +106,7 @@ |
||
106 | 106 | * @param int $duplicate_entry_time |
107 | 107 | * @return bool |
108 | 108 | */ |
109 | - private static function is_duplicate_check_needed( $values, $duplicate_entry_time ){ |
|
109 | + private static function is_duplicate_check_needed( $values, $duplicate_entry_time ) { |
|
110 | 110 | // If time for checking duplicates is set to an empty value, don't check for duplicates |
111 | 111 | if ( empty( $duplicate_entry_time ) ) { |
112 | 112 | return false; |