@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | 'payments' => $frm_payment->get_count(), |
118 | 118 | 'subscriptions' => $frm_sub->get_count(), |
119 | 119 | ); |
120 | - $type = FrmAppHelper::get_simple_request( |
|
120 | + $type = FrmAppHelper::get_simple_request( |
|
121 | 121 | array( |
122 | 122 | 'param' => 'trans_type', |
123 | 123 | 'type' => 'request', |
@@ -132,10 +132,10 @@ discard block |
||
132 | 132 | $class = ''; |
133 | 133 | } |
134 | 134 | |
135 | - if ( $counts[ $status ] || 'published' === $status ) { |
|
136 | - $links[ $status ] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>' |
|
135 | + if ( $counts[$status] || 'published' === $status ) { |
|
136 | + $links[$status] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>' |
|
137 | 137 | // translators: %1$s: Transaction type (Payments or Subscriptions), %2$s: Span start tag, %3$s: Count, %3$s: Span close tag. |
138 | - . sprintf( esc_html__( '%1$s %2$s(%3$s)%4$s', 'formidable' ), esc_html( $name ), '<span class="count">', number_format_i18n( $counts[ $status ] ), '</span>' ) |
|
138 | + . sprintf( esc_html__( '%1$s %2$s(%3$s)%4$s', 'formidable' ), esc_html( $name ), '<span class="count">', number_format_i18n( $counts[$status] ), '</span>' ) |
|
139 | 139 | . '</a>'; |
140 | 140 | } |
141 | 141 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | echo '<tr id="payment-' . esc_attr( $item->id ) . '" '; |
213 | 213 | |
214 | 214 | $is_alternate = 0 === $alt % 2; |
215 | - ++$alt; |
|
215 | + ++ $alt; |
|
216 | 216 | |
217 | 217 | if ( $is_alternate ) { |
218 | 218 | echo 'class="alternate"'; |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | |
304 | 304 | $form_ids = array(); |
305 | 305 | foreach ( $forms as $form ) { |
306 | - $form_ids[ $form->id ] = $form; |
|
306 | + $form_ids[$form->id] = $form; |
|
307 | 307 | unset( $form ); |
308 | 308 | } |
309 | 309 | |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | 'href' => esc_url( $link ), |
355 | 355 | 'title' => __( 'View', 'formidable' ), |
356 | 356 | ); |
357 | - $link = '<a ' . FrmAppHelper::array_to_html_params( $link_params ) . '>' |
|
357 | + $link = '<a ' . FrmAppHelper::array_to_html_params( $link_params ) . '>' |
|
358 | 358 | . $item->{$field} |
359 | 359 | . '</a>'; |
360 | 360 | |
@@ -409,8 +409,8 @@ discard block |
||
409 | 409 | * @return mixed |
410 | 410 | */ |
411 | 411 | private function get_form_id_column( $item, $atts ) { |
412 | - if ( isset( $atts['form_ids'][ $item->item_id ] ) ) { |
|
413 | - $form_link = FrmFormsHelper::edit_form_link( $atts['form_ids'][ $item->item_id ]->form_id ); |
|
412 | + if ( isset( $atts['form_ids'][$item->item_id] ) ) { |
|
413 | + $form_link = FrmFormsHelper::edit_form_link( $atts['form_ids'][$item->item_id]->form_id ); |
|
414 | 414 | return $form_link; |
415 | 415 | } |
416 | 416 | |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | */ |
486 | 486 | private function get_processing_tooltip() { |
487 | 487 | return FrmAppHelper::clip( |
488 | - function () { |
|
488 | + function() { |
|
489 | 489 | $params = array( |
490 | 490 | 'class' => 'frm_help frm_icon_font frm_tooltip_icon', |
491 | 491 | 'title' => __( 'This payment method may take between 4-5 business days to process.', 'formidable' ), |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public static function show_status( $status ) { |
68 | 68 | $statuses = array_merge( self::get_payment_statuses(), self::get_subscription_statuses() ); |
69 | - return isset( $statuses[ $status ] ) ? $statuses[ $status ] : $status; |
|
69 | + return isset( $statuses[$status] ) ? $statuses[$status] : $status; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public static function get_action_setting( $option, $atts ) { |
154 | 154 | $settings = self::get_action_settings( $atts ); |
155 | - $value = isset( $settings[ $option ] ) ? $settings[ $option ] : ''; |
|
155 | + $value = isset( $settings[$option] ) ? $settings[$option] : ''; |
|
156 | 156 | return $value; |
157 | 157 | } |
158 | 158 | |
@@ -255,8 +255,8 @@ discard block |
||
255 | 255 | */ |
256 | 256 | public static function get_repeat_label_from_value( $value, $number ) { |
257 | 257 | $times = self::get_plural_repeat_times( $number ); |
258 | - if ( isset( $times[ $value ] ) ) { |
|
259 | - $value = $times[ $value ]; |
|
258 | + if ( isset( $times[$value] ) ) { |
|
259 | + $value = $times[$value]; |
|
260 | 260 | } |
261 | 261 | return $value; |
262 | 262 | } |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | $count = 0; |
505 | 505 | foreach ( $payments as $payment ) { |
506 | 506 | if ( $payment->status === 'complete' ) { |
507 | - $count++; |
|
507 | + $count ++; |
|
508 | 508 | } |
509 | 509 | } |
510 | 510 |
@@ -314,8 +314,8 @@ discard block |
||
314 | 314 | ); |
315 | 315 | |
316 | 316 | $where_is = strtolower( $where_is ); |
317 | - if ( isset( $switch_to[ $where_is ] ) ) { |
|
318 | - return ' ' . $switch_to[ $where_is ]; |
|
317 | + if ( isset( $switch_to[$where_is] ) ) { |
|
318 | + return ' ' . $switch_to[$where_is]; |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | // > and < need a little more work since we don't want them switched to >= and <= |
@@ -380,13 +380,13 @@ discard block |
||
380 | 380 | $temp_args = $args; |
381 | 381 | foreach ( $temp_args as $k => $v ) { |
382 | 382 | if ( $v == '' ) { |
383 | - unset( $args[ $k ] ); |
|
383 | + unset( $args[$k] ); |
|
384 | 384 | continue; |
385 | 385 | } |
386 | 386 | |
387 | 387 | $db_name = strtoupper( str_replace( '_', ' ', $k ) ); |
388 | 388 | if ( strpos( $v, $db_name ) === false ) { |
389 | - $args[ $k ] = $db_name . ' ' . $v; |
|
389 | + $args[$k] = $db_name . ' ' . $v; |
|
390 | 390 | } |
391 | 391 | } |
392 | 392 | |
@@ -460,13 +460,13 @@ discard block |
||
460 | 460 | private static function esc_query_args( &$args ) { |
461 | 461 | foreach ( $args as $param => $value ) { |
462 | 462 | if ( $param === 'order_by' ) { |
463 | - $args[ $param ] = self::esc_order( $value ); |
|
463 | + $args[$param] = self::esc_order( $value ); |
|
464 | 464 | } elseif ( $param === 'limit' ) { |
465 | - $args[ $param ] = self::esc_limit( $value ); |
|
465 | + $args[$param] = self::esc_limit( $value ); |
|
466 | 466 | } |
467 | 467 | |
468 | - if ( $args[ $param ] == '' ) { |
|
469 | - unset( $args[ $param ] ); |
|
468 | + if ( $args[$param] == '' ) { |
|
469 | + unset( $args[$param] ); |
|
470 | 470 | } |
471 | 471 | } |
472 | 472 | } |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | $limit = explode( ',', trim( $limit ) ); |
549 | 549 | foreach ( $limit as $k => $l ) { |
550 | 550 | if ( is_numeric( $l ) ) { |
551 | - $limit[ $k ] = $l; |
|
551 | + $limit[$k] = $l; |
|
552 | 552 | } |
553 | 553 | } |
554 | 554 | |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | */ |
702 | 702 | public static function add_key_to_group_cache( $key, $group ) { |
703 | 703 | $cached = self::get_group_cached_keys( $group ); |
704 | - $cached[ $key ] = $key; |
|
704 | + $cached[$key] = $key; |
|
705 | 705 | wp_cache_set( 'cached_keys', $cached, $group, 300 ); |
706 | 706 | } |
707 | 707 |
@@ -5,7 +5,7 @@ |
||
5 | 5 | |
6 | 6 | add_filter( |
7 | 7 | 'document_title', |
8 | - function ( $title ) use ( $form ) { |
|
8 | + function( $title ) use ( $form ) { |
|
9 | 9 | $form_name = '' === $form->name ? __( '(no title)', 'formidable' ) : $form->name; |
10 | 10 | return get_bloginfo( 'name', 'display' ) . ' | ' . wp_strip_all_tags( $form_name ); |
11 | 11 | } |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | |
235 | 235 | // This may occasionally skip one level/order e.g. after adding a |
236 | 236 | // list field, as field_order would already be prepared to be used. |
237 | - ++$field_order; |
|
237 | + ++ $field_order; |
|
238 | 238 | |
239 | 239 | if ( ! empty( $new_field['fields'] ) && is_array( $new_field['fields'] ) ) { |
240 | 240 | // we have (inner) fields to merge |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | |
273 | 273 | $order = 0; |
274 | 274 | foreach ( $fields as $field ) { |
275 | - ++$order; |
|
275 | + ++ $order; |
|
276 | 276 | $type = $this->get_field_type( $field ); |
277 | 277 | $new_type = $this->convert_field_type( $type, $field ); |
278 | 278 | if ( ! in_array( $new_type, $with_end ) && $new_type !== 'break' ) { |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | $sub['name'] = __( 'Section Buttons', 'formidable' ); |
303 | 303 | $subs = array( $sub ); |
304 | 304 | $this->insert_fields_in_array( $subs, $order, 0, $fields ); |
305 | - ++$order; |
|
305 | + ++ $order; |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | /** |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | protected function create_fields( $form_id, &$form ) { |
400 | 400 | foreach ( $form['fields'] as $key => $new_field ) { |
401 | 401 | $new_field['form_id'] = $form_id; |
402 | - $form['fields'][ $key ]['id'] = FrmField::create( $new_field ); |
|
402 | + $form['fields'][$key]['id'] = FrmField::create( $new_field ); |
|
403 | 403 | } |
404 | 404 | } |
405 | 405 | |
@@ -433,9 +433,9 @@ discard block |
||
433 | 433 | } elseif ( $key === 'the_post_title' ) { |
434 | 434 | $new_action->post_content['post_title'] = $value; |
435 | 435 | } elseif ( is_string( $value ) ) { |
436 | - $new_action->post_content[ $key ] = $this->replace_smart_tags( $value, $form['fields'] ); |
|
436 | + $new_action->post_content[$key] = $this->replace_smart_tags( $value, $form['fields'] ); |
|
437 | 437 | } else { |
438 | - $new_action->post_content[ $key ] = $value; |
|
438 | + $new_action->post_content[$key] = $value; |
|
439 | 439 | } |
440 | 440 | } |
441 | 441 | |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | |
455 | 455 | $imported = $this->get_tracked_import(); |
456 | 456 | |
457 | - $imported[ $this->slug ][ $new_form_id ] = $source_id; |
|
457 | + $imported[$this->slug][$new_form_id] = $source_id; |
|
458 | 458 | |
459 | 459 | update_option( $this->tracking, $imported, false ); |
460 | 460 | } |
@@ -474,11 +474,11 @@ discard block |
||
474 | 474 | private function is_imported( $source_id ) { |
475 | 475 | $imported = $this->get_tracked_import(); |
476 | 476 | $new_form_id = 0; |
477 | - if ( ! isset( $imported[ $this->slug ] ) || ! in_array( $source_id, $imported[ $this->slug ] ) ) { |
|
477 | + if ( ! isset( $imported[$this->slug] ) || ! in_array( $source_id, $imported[$this->slug] ) ) { |
|
478 | 478 | return $new_form_id; |
479 | 479 | } |
480 | 480 | |
481 | - $new_form_id = array_search( $source_id, array_reverse( $imported[ $this->slug ], true ) ); |
|
481 | + $new_form_id = array_search( $source_id, array_reverse( $imported[$this->slug], true ) ); |
|
482 | 482 | if ( ! empty( $new_form_id ) && empty( FrmForm::get_key_by_id( $new_form_id ) ) ) { |
483 | 483 | // Allow reimport if the form was deleted. |
484 | 484 | $new_form_id = 0; |
@@ -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; |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | * @param array $match Shortcode data. |
468 | 468 | * @return string |
469 | 469 | */ |
470 | - function ( $match ) { |
|
470 | + function( $match ) { |
|
471 | 471 | $attr = shortcode_parse_atts( $match[3] ); |
472 | 472 | $safe_atts = array(); |
473 | 473 | foreach ( $attr as $attr_key => $att ) { |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | } |
487 | 487 | |
488 | 488 | if ( FrmAppHelper::input_key_is_safe( $key, 'update' ) ) { |
489 | - $safe_atts[ $key ] = $value; |
|
489 | + $safe_atts[$key] = $value; |
|
490 | 490 | } |
491 | 491 | } |
492 | 492 | |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) { |
545 | 545 | global $frm_duplicate_ids; |
546 | 546 | |
547 | - $where = array( |
|
547 | + $where = array( |
|
548 | 548 | array( |
549 | 549 | 'or' => 1, |
550 | 550 | 'fi.form_id' => $old_form_id, |
@@ -590,8 +590,8 @@ discard block |
||
590 | 590 | |
591 | 591 | $values = apply_filters( 'frm_duplicated_field', $values ); |
592 | 592 | $new_id = self::create( $values ); |
593 | - $frm_duplicate_ids[ $field->id ] = $new_id; |
|
594 | - $frm_duplicate_ids[ $field->field_key ] = $new_id; |
|
593 | + $frm_duplicate_ids[$field->id] = $new_id; |
|
594 | + $frm_duplicate_ids[$field->field_key] = $new_id; |
|
595 | 595 | unset( $field ); |
596 | 596 | }//end foreach |
597 | 597 | } |
@@ -640,11 +640,11 @@ discard block |
||
640 | 640 | |
641 | 641 | // serialize array values |
642 | 642 | foreach ( array( 'field_options', 'options' ) as $opt ) { |
643 | - if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) { |
|
643 | + if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) { |
|
644 | 644 | if ( 'field_options' === $opt ) { |
645 | - $values[ $opt ] = self::maybe_filter_options( $values[ $opt ] ); |
|
645 | + $values[$opt] = self::maybe_filter_options( $values[$opt] ); |
|
646 | 646 | } |
647 | - $values[ $opt ] = serialize( $values[ $opt ] ); |
|
647 | + $values[$opt] = serialize( $values[$opt] ); |
|
648 | 648 | } |
649 | 649 | } |
650 | 650 | if ( isset( $values['default_value'] ) && is_array( $values['default_value'] ) ) { |
@@ -799,7 +799,7 @@ discard block |
||
799 | 799 | 'id' => $id, |
800 | 800 | 'field_key' => $id, |
801 | 801 | ); |
802 | - $type = FrmDb::get_var( 'frm_fields', $where, $col ); |
|
802 | + $type = FrmDb::get_var( 'frm_fields', $where, $col ); |
|
803 | 803 | } |
804 | 804 | |
805 | 805 | return $type; |
@@ -831,8 +831,8 @@ discard block |
||
831 | 831 | continue; |
832 | 832 | } |
833 | 833 | |
834 | - $fields[ $result->id ] = $result; |
|
835 | - ++$count; |
|
834 | + $fields[$result->id] = $result; |
|
835 | + ++ $count; |
|
836 | 836 | if ( $limit == 1 ) { |
837 | 837 | $fields = $result; |
838 | 838 | break; |
@@ -883,8 +883,8 @@ discard block |
||
883 | 883 | $fields = array(); |
884 | 884 | $count = 0; |
885 | 885 | foreach ( $results as $result ) { |
886 | - ++$count; |
|
887 | - $fields[ $result->id ] = $result; |
|
886 | + ++ $count; |
|
887 | + $fields[$result->id] = $result; |
|
888 | 888 | if ( ! empty( $limit ) && $count >= $limit ) { |
889 | 889 | break; |
890 | 890 | } |
@@ -998,7 +998,7 @@ discard block |
||
998 | 998 | $query_type = $limit === ' LIMIT 1' || $limit == 1 ? 'row' : 'results'; |
999 | 999 | |
1000 | 1000 | if ( is_array( $where ) ) { |
1001 | - $args = array( |
|
1001 | + $args = array( |
|
1002 | 1002 | 'order_by' => $order_by, |
1003 | 1003 | 'limit' => $limit, |
1004 | 1004 | ); |
@@ -1029,9 +1029,9 @@ discard block |
||
1029 | 1029 | FrmDb::set_cache( $result->field_key, $result, 'frm_field' ); |
1030 | 1030 | |
1031 | 1031 | self::prepare_options( $result ); |
1032 | - $results[ $r_key ]->field_options = $result->field_options; |
|
1033 | - $results[ $r_key ]->options = $result->options; |
|
1034 | - $results[ $r_key ]->default_value = $result->default_value; |
|
1032 | + $results[$r_key]->field_options = $result->field_options; |
|
1033 | + $results[$r_key]->options = $result->options; |
|
1034 | + $results[$r_key]->default_value = $result->default_value; |
|
1035 | 1035 | |
1036 | 1036 | unset( $r_key, $result ); |
1037 | 1037 | } |
@@ -1087,7 +1087,7 @@ discard block |
||
1087 | 1087 | |
1088 | 1088 | if ( count( $next_fields ) >= self::$transient_size ) { |
1089 | 1089 | // if this transient is full, check for another |
1090 | - ++$next; |
|
1090 | + ++ $next; |
|
1091 | 1091 | self::get_next_transient( $fields, $base_name, $next ); |
1092 | 1092 | } |
1093 | 1093 | } |
@@ -1115,7 +1115,7 @@ discard block |
||
1115 | 1115 | return; |
1116 | 1116 | } |
1117 | 1117 | |
1118 | - ++$next; |
|
1118 | + ++ $next; |
|
1119 | 1119 | } |
1120 | 1120 | } |
1121 | 1121 | |
@@ -1263,7 +1263,7 @@ discard block |
||
1263 | 1263 | * @return bool |
1264 | 1264 | */ |
1265 | 1265 | public static function is_option_true_in_array( $field, $option ) { |
1266 | - return ! empty( $field[ $option ] ); |
|
1266 | + return ! empty( $field[$option] ); |
|
1267 | 1267 | } |
1268 | 1268 | |
1269 | 1269 | /** |
@@ -1272,7 +1272,7 @@ discard block |
||
1272 | 1272 | * @return bool |
1273 | 1273 | */ |
1274 | 1274 | public static function is_option_true_in_object( $field, $option ) { |
1275 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ]; |
|
1275 | + return isset( $field->field_options[$option] ) && $field->field_options[$option]; |
|
1276 | 1276 | } |
1277 | 1277 | |
1278 | 1278 | /** |
@@ -1281,7 +1281,7 @@ discard block |
||
1281 | 1281 | * @return bool |
1282 | 1282 | */ |
1283 | 1283 | public static function is_option_empty_in_array( $field, $option ) { |
1284 | - return empty( $field[ $option ] ); |
|
1284 | + return empty( $field[$option] ); |
|
1285 | 1285 | } |
1286 | 1286 | |
1287 | 1287 | /** |
@@ -1290,7 +1290,7 @@ discard block |
||
1290 | 1290 | * @return bool |
1291 | 1291 | */ |
1292 | 1292 | public static function is_option_empty_in_object( $field, $option ) { |
1293 | - return empty( $field->field_options[ $option ] ); |
|
1293 | + return empty( $field->field_options[$option] ); |
|
1294 | 1294 | } |
1295 | 1295 | |
1296 | 1296 | /** |
@@ -1299,7 +1299,7 @@ discard block |
||
1299 | 1299 | * @return bool |
1300 | 1300 | */ |
1301 | 1301 | public static function is_option_value_in_object( $field, $option ) { |
1302 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != ''; |
|
1302 | + return isset( $field->field_options[$option] ) && $field->field_options[$option] != ''; |
|
1303 | 1303 | } |
1304 | 1304 | |
1305 | 1305 | /** |
@@ -1325,10 +1325,10 @@ discard block |
||
1325 | 1325 | * @return mixed |
1326 | 1326 | */ |
1327 | 1327 | public static function get_option_in_array( $field, $option ) { |
1328 | - if ( isset( $field[ $option ] ) ) { |
|
1329 | - $this_option = $field[ $option ]; |
|
1330 | - } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) { |
|
1331 | - $this_option = $field['field_options'][ $option ]; |
|
1328 | + if ( isset( $field[$option] ) ) { |
|
1329 | + $this_option = $field[$option]; |
|
1330 | + } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) { |
|
1331 | + $this_option = $field['field_options'][$option]; |
|
1332 | 1332 | } else { |
1333 | 1333 | $this_option = ''; |
1334 | 1334 | } |
@@ -1342,7 +1342,7 @@ discard block |
||
1342 | 1342 | * @return mixed |
1343 | 1343 | */ |
1344 | 1344 | public static function get_option_in_object( $field, $option ) { |
1345 | - return isset( $field->field_options[ $option ] ) ? $field->field_options[ $option ] : ''; |
|
1345 | + return isset( $field->field_options[$option] ) ? $field->field_options[$option] : ''; |
|
1346 | 1346 | } |
1347 | 1347 | |
1348 | 1348 | /** |