@@ -304,8 +304,8 @@ discard block |
||
304 | 304 | require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
305 | 305 | } |
306 | 306 | $plugins = get_plugins(); |
307 | - if ( isset( $plugins[ $plugin ] ) && ! empty( $plugins[ $plugin ]['Version'] ) ) { |
|
308 | - return $plugins[ $plugin ]['Version']; |
|
307 | + if ( isset( $plugins[$plugin] ) && ! empty( $plugins[$plugin]['Version'] ) ) { |
|
308 | + return $plugins[$plugin]['Version']; |
|
309 | 309 | } |
310 | 310 | return false; |
311 | 311 | } |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | $values = FrmAppHelper::maybe_filter_array( $values, array( 'name', 'description' ) ); |
379 | 379 | |
380 | 380 | foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) { |
381 | - $new_values[ $col ] = $values[ $col ]; |
|
381 | + $new_values[$col] = $values[$col]; |
|
382 | 382 | } |
383 | 383 | |
384 | 384 | $new_values['options'] = self::maybe_filter_options( $values['options'] ); |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | $new_values['created_at'] = current_time( 'mysql', 1 ); |
390 | 390 | |
391 | 391 | if ( isset( $values['id'] ) ) { |
392 | - $frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key']; |
|
392 | + $frm_duplicate_ids[$values['field_key']] = $new_values['field_key']; |
|
393 | 393 | $new_values = apply_filters( 'frm_duplicated_field', $new_values ); |
394 | 394 | } |
395 | 395 | |
@@ -398,9 +398,9 @@ discard block |
||
398 | 398 | foreach ( $new_values as $k => $v ) { |
399 | 399 | if ( is_array( $v ) ) { |
400 | 400 | if ( $k === 'default_value' ) { |
401 | - $new_values[ $k ] = FrmAppHelper::maybe_json_encode( $v ); |
|
401 | + $new_values[$k] = FrmAppHelper::maybe_json_encode( $v ); |
|
402 | 402 | } else { |
403 | - $new_values[ $k ] = serialize( $v ); |
|
403 | + $new_values[$k] = serialize( $v ); |
|
404 | 404 | } |
405 | 405 | } |
406 | 406 | unset( $k, $v ); |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | } |
421 | 421 | |
422 | 422 | if ( isset( $values['id'] ) ) { |
423 | - $frm_duplicate_ids[ $values['id'] ] = $new_id; |
|
423 | + $frm_duplicate_ids[$values['id']] = $new_id; |
|
424 | 424 | } |
425 | 425 | |
426 | 426 | return $new_id; |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | * @param array $match Shortcode data. |
472 | 472 | * @return string |
473 | 473 | */ |
474 | - function ( $match ) { |
|
474 | + function( $match ) { |
|
475 | 475 | $attr = shortcode_parse_atts( $match[3] ); |
476 | 476 | |
477 | 477 | if ( ! is_array( $attr ) ) { |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | } |
497 | 497 | |
498 | 498 | if ( FrmAppHelper::input_key_is_safe( $key, 'update' ) ) { |
499 | - $safe_atts[ $key ] = $value; |
|
499 | + $safe_atts[$key] = $value; |
|
500 | 500 | } |
501 | 501 | } |
502 | 502 | |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) { |
555 | 555 | global $frm_duplicate_ids; |
556 | 556 | |
557 | - $where = array( |
|
557 | + $where = array( |
|
558 | 558 | array( |
559 | 559 | 'or' => 1, |
560 | 560 | 'fi.form_id' => $old_form_id, |
@@ -600,8 +600,8 @@ discard block |
||
600 | 600 | |
601 | 601 | $values = apply_filters( 'frm_duplicated_field', $values ); |
602 | 602 | $new_id = self::create( $values ); |
603 | - $frm_duplicate_ids[ $field->id ] = $new_id; |
|
604 | - $frm_duplicate_ids[ $field->field_key ] = $new_id; |
|
603 | + $frm_duplicate_ids[$field->id] = $new_id; |
|
604 | + $frm_duplicate_ids[$field->field_key] = $new_id; |
|
605 | 605 | unset( $field ); |
606 | 606 | }//end foreach |
607 | 607 | } |
@@ -650,11 +650,11 @@ discard block |
||
650 | 650 | |
651 | 651 | // serialize array values |
652 | 652 | foreach ( array( 'field_options', 'options' ) as $opt ) { |
653 | - if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) { |
|
653 | + if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) { |
|
654 | 654 | if ( 'field_options' === $opt ) { |
655 | - $values[ $opt ] = self::maybe_filter_options( $values[ $opt ] ); |
|
655 | + $values[$opt] = self::maybe_filter_options( $values[$opt] ); |
|
656 | 656 | } |
657 | - $values[ $opt ] = serialize( $values[ $opt ] ); |
|
657 | + $values[$opt] = serialize( $values[$opt] ); |
|
658 | 658 | } |
659 | 659 | } |
660 | 660 | if ( isset( $values['default_value'] ) && is_array( $values['default_value'] ) ) { |
@@ -841,8 +841,8 @@ discard block |
||
841 | 841 | continue; |
842 | 842 | } |
843 | 843 | |
844 | - $fields[ $result->id ] = $result; |
|
845 | - ++$count; |
|
844 | + $fields[$result->id] = $result; |
|
845 | + ++ $count; |
|
846 | 846 | if ( $limit == 1 ) { |
847 | 847 | $fields = $result; |
848 | 848 | break; |
@@ -893,8 +893,8 @@ discard block |
||
893 | 893 | $fields = array(); |
894 | 894 | $count = 0; |
895 | 895 | foreach ( $results as $result ) { |
896 | - ++$count; |
|
897 | - $fields[ $result->id ] = $result; |
|
896 | + ++ $count; |
|
897 | + $fields[$result->id] = $result; |
|
898 | 898 | if ( ! empty( $limit ) && $count >= $limit ) { |
899 | 899 | break; |
900 | 900 | } |
@@ -1008,7 +1008,7 @@ discard block |
||
1008 | 1008 | $query_type = $limit === ' LIMIT 1' || $limit == 1 ? 'row' : 'results'; |
1009 | 1009 | |
1010 | 1010 | if ( is_array( $where ) ) { |
1011 | - $args = array( |
|
1011 | + $args = array( |
|
1012 | 1012 | 'order_by' => $order_by, |
1013 | 1013 | 'limit' => $limit, |
1014 | 1014 | ); |
@@ -1041,9 +1041,9 @@ discard block |
||
1041 | 1041 | FrmDb::set_cache( $result->field_key, $result, 'frm_field' ); |
1042 | 1042 | |
1043 | 1043 | self::prepare_options( $result ); |
1044 | - $results[ $r_key ]->field_options = $result->field_options; |
|
1045 | - $results[ $r_key ]->options = $result->options; |
|
1046 | - $results[ $r_key ]->default_value = $result->default_value; |
|
1044 | + $results[$r_key]->field_options = $result->field_options; |
|
1045 | + $results[$r_key]->options = $result->options; |
|
1046 | + $results[$r_key]->default_value = $result->default_value; |
|
1047 | 1047 | |
1048 | 1048 | unset( $r_key, $result ); |
1049 | 1049 | } |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | |
1123 | 1123 | if ( count( $next_fields ) >= self::$transient_size ) { |
1124 | 1124 | // if this transient is full, check for another |
1125 | - ++$next; |
|
1125 | + ++ $next; |
|
1126 | 1126 | self::get_next_transient( $fields, $base_name, $next ); |
1127 | 1127 | } |
1128 | 1128 | } |
@@ -1150,7 +1150,7 @@ discard block |
||
1150 | 1150 | return; |
1151 | 1151 | } |
1152 | 1152 | |
1153 | - ++$next; |
|
1153 | + ++ $next; |
|
1154 | 1154 | } |
1155 | 1155 | } |
1156 | 1156 | |
@@ -1298,7 +1298,7 @@ discard block |
||
1298 | 1298 | * @return bool |
1299 | 1299 | */ |
1300 | 1300 | public static function is_option_true_in_array( $field, $option ) { |
1301 | - return ! empty( $field[ $option ] ); |
|
1301 | + return ! empty( $field[$option] ); |
|
1302 | 1302 | } |
1303 | 1303 | |
1304 | 1304 | /** |
@@ -1307,7 +1307,7 @@ discard block |
||
1307 | 1307 | * @return bool |
1308 | 1308 | */ |
1309 | 1309 | public static function is_option_true_in_object( $field, $option ) { |
1310 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ]; |
|
1310 | + return isset( $field->field_options[$option] ) && $field->field_options[$option]; |
|
1311 | 1311 | } |
1312 | 1312 | |
1313 | 1313 | /** |
@@ -1316,7 +1316,7 @@ discard block |
||
1316 | 1316 | * @return bool |
1317 | 1317 | */ |
1318 | 1318 | public static function is_option_empty_in_array( $field, $option ) { |
1319 | - return empty( $field[ $option ] ); |
|
1319 | + return empty( $field[$option] ); |
|
1320 | 1320 | } |
1321 | 1321 | |
1322 | 1322 | /** |
@@ -1325,7 +1325,7 @@ discard block |
||
1325 | 1325 | * @return bool |
1326 | 1326 | */ |
1327 | 1327 | public static function is_option_empty_in_object( $field, $option ) { |
1328 | - return empty( $field->field_options[ $option ] ); |
|
1328 | + return empty( $field->field_options[$option] ); |
|
1329 | 1329 | } |
1330 | 1330 | |
1331 | 1331 | /** |
@@ -1334,7 +1334,7 @@ discard block |
||
1334 | 1334 | * @return bool |
1335 | 1335 | */ |
1336 | 1336 | public static function is_option_value_in_object( $field, $option ) { |
1337 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != ''; |
|
1337 | + return isset( $field->field_options[$option] ) && $field->field_options[$option] != ''; |
|
1338 | 1338 | } |
1339 | 1339 | |
1340 | 1340 | /** |
@@ -1360,10 +1360,10 @@ discard block |
||
1360 | 1360 | * @return mixed |
1361 | 1361 | */ |
1362 | 1362 | public static function get_option_in_array( $field, $option ) { |
1363 | - if ( isset( $field[ $option ] ) ) { |
|
1364 | - $this_option = $field[ $option ]; |
|
1365 | - } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) { |
|
1366 | - $this_option = $field['field_options'][ $option ]; |
|
1363 | + if ( isset( $field[$option] ) ) { |
|
1364 | + $this_option = $field[$option]; |
|
1365 | + } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) { |
|
1366 | + $this_option = $field['field_options'][$option]; |
|
1367 | 1367 | } else { |
1368 | 1368 | $this_option = ''; |
1369 | 1369 | } |
@@ -1377,7 +1377,7 @@ discard block |
||
1377 | 1377 | * @return mixed |
1378 | 1378 | */ |
1379 | 1379 | public static function get_option_in_object( $field, $option ) { |
1380 | - return isset( $field->field_options[ $option ] ) ? $field->field_options[ $option ] : ''; |
|
1380 | + return isset( $field->field_options[$option] ) ? $field->field_options[$option] : ''; |
|
1381 | 1381 | } |
1382 | 1382 | |
1383 | 1383 | /** |