|
@@ -28,7 +28,7 @@ discard block |
|
|
block discarded – undo |
|
28
|
28
|
'class' => '', |
|
29
|
29
|
'inc_children' => 'exclude', |
|
30
|
30
|
); |
|
31
|
|
- $args = wp_parse_args( $args, $defaults ); |
|
|
31
|
+ $args = wp_parse_args( $args, $defaults ); |
|
32
|
32
|
|
|
33
|
33
|
if ( ! $args['field_id'] ) { |
|
34
|
34
|
$args['field_id'] = $field_name; |
|
@@ -70,7 +70,7 @@ discard block |
|
|
block discarded – undo |
|
70
|
70
|
*/ |
|
71
|
71
|
public static function add_html_attr( $class, $param, &$add_html ) { |
|
72
|
72
|
if ( ! empty( $class ) ) { |
|
73
|
|
- $add_html[ $param ] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
|
73
|
+ $add_html[$param] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
74
|
74
|
} |
|
75
|
75
|
} |
|
76
|
76
|
|
|
@@ -276,8 +276,8 @@ discard block |
|
|
block discarded – undo |
|
276
|
276
|
'description' => '', |
|
277
|
277
|
); |
|
278
|
278
|
foreach ( $defaults as $var => $default ) { |
|
279
|
|
- if ( ! isset( $values[ $var ] ) ) { |
|
280
|
|
- $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
|
279
|
+ if ( ! isset( $values[$var] ) ) { |
|
|
280
|
+ $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
281
|
281
|
} |
|
282
|
282
|
} |
|
283
|
283
|
|
|
@@ -292,8 +292,8 @@ discard block |
|
|
block discarded – undo |
|
292
|
292
|
'parent_form_id' => 0, |
|
293
|
293
|
); |
|
294
|
294
|
foreach ( $defaults as $var => $default ) { |
|
295
|
|
- if ( ! isset( $values[ $var ] ) ) { |
|
296
|
|
- $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
|
295
|
+ if ( ! isset( $values[$var] ) ) { |
|
|
296
|
+ $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
297
|
297
|
} |
|
298
|
298
|
} |
|
299
|
299
|
unset( $defaults ); |
|
@@ -330,16 +330,16 @@ discard block |
|
|
block discarded – undo |
|
330
|
330
|
$defaults = self::get_default_opts(); |
|
331
|
331
|
foreach ( $defaults as $var => $default ) { |
|
332
|
332
|
if ( is_array( $default ) ) { |
|
333
|
|
- if ( ! isset( $values[ $var ] ) ) { |
|
334
|
|
- $values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array(); |
|
|
333
|
+ if ( ! isset( $values[$var] ) ) { |
|
|
334
|
+ $values[$var] = ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : array(); |
|
335
|
335
|
} |
|
336
|
336
|
|
|
337
|
337
|
foreach ( $default as $k => $v ) { |
|
338
|
|
- $values[ $var ][ $k ] = ( $post_values && isset( $post_values[ $var ][ $k ] ) ) ? $post_values[ $var ][ $k ] : ( ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) ) ? $record->options[ $var ][ $k ] : $v ); |
|
|
338
|
+ $values[$var][$k] = ( $post_values && isset( $post_values[$var][$k] ) ) ? $post_values[$var][$k] : ( ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) ) ? $record->options[$var][$k] : $v ); |
|
339
|
339
|
|
|
340
|
340
|
if ( is_array( $v ) ) { |
|
341
|
341
|
foreach ( $v as $k1 => $v1 ) { |
|
342
|
|
- $values[ $var ][ $k ][ $k1 ] = ( $post_values && isset( $post_values[ $var ][ $k ][ $k1 ] ) ) ? $post_values[ $var ][ $k ][ $k1 ] : ( ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) && isset( $record->options[ $var ][ $k ][ $k1 ] ) ) ? $record->options[ $var ][ $k ][ $k1 ] : $v1 ); |
|
|
342
|
+ $values[$var][$k][$k1] = ( $post_values && isset( $post_values[$var][$k][$k1] ) ) ? $post_values[$var][$k][$k1] : ( ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) && isset( $record->options[$var][$k][$k1] ) ) ? $record->options[$var][$k][$k1] : $v1 ); |
|
343
|
343
|
unset( $k1, $v1 ); |
|
344
|
344
|
} |
|
345
|
345
|
} |
|
@@ -347,7 +347,7 @@ discard block |
|
|
block discarded – undo |
|
347
|
347
|
unset( $k, $v ); |
|
348
|
348
|
} |
|
349
|
349
|
} else { |
|
350
|
|
- $values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default ); |
|
|
350
|
+ $values[$var] = ( $post_values && isset( $post_values['options'][$var] ) ) ? $post_values['options'][$var] : ( ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : $default ); |
|
351
|
351
|
} |
|
352
|
352
|
|
|
353
|
353
|
unset( $var, $default ); |
|
@@ -385,7 +385,7 @@ discard block |
|
|
block discarded – undo |
|
385
|
385
|
public static function fill_form_options( &$options, $values ) { |
|
386
|
386
|
$defaults = self::get_default_opts(); |
|
387
|
387
|
foreach ( $defaults as $var => $default ) { |
|
388
|
|
- $options[ $var ] = isset( $values['options'][ $var ] ) ? $values['options'][ $var ] : $default; |
|
|
388
|
+ $options[$var] = isset( $values['options'][$var] ) ? $values['options'][$var] : $default; |
|
389
|
389
|
unset( $var, $default ); |
|
390
|
390
|
} |
|
391
|
391
|
} |
|
@@ -541,7 +541,7 @@ discard block |
|
|
block discarded – undo |
|
541
|
541
|
public static function insert_opt_html( $args ) { |
|
542
|
542
|
$class = isset( $args['class'] ) ? $args['class'] : ''; |
|
543
|
543
|
$fields = FrmField::all_field_selection(); |
|
544
|
|
- $field = isset( $fields[ $args['type'] ] ) ? $fields[ $args['type'] ] : array(); |
|
|
544
|
+ $field = isset( $fields[$args['type']] ) ? $fields[$args['type']] : array(); |
|
545
|
545
|
|
|
546
|
546
|
self::prepare_field_type( $field ); |
|
547
|
547
|
|
|
@@ -693,7 +693,7 @@ discard block |
|
|
block discarded – undo |
|
693
|
693
|
FrmField::update( $field->id, array( 'field_order' => $field->field_order + 2 ) ); |
|
694
|
694
|
} |
|
695
|
695
|
|
|
696
|
|
- $add_order += 2; |
|
|
696
|
+ $add_order += 2; |
|
697
|
697
|
$open = false; |
|
698
|
698
|
$reset_fields = true; |
|
699
|
699
|
} |
|
@@ -1045,10 +1045,10 @@ discard block |
|
|
block discarded – undo |
|
1045
|
1045
|
$link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"'; |
|
1046
|
1046
|
} |
|
1047
|
1047
|
|
|
1048
|
|
- $label = ( isset( $link_details[ $length ] ) ? $link_details[ $length ] : $link_details['label'] ); |
|
1049
|
|
- if ( $length == 'icon' && isset( $link_details[ $length ] ) ) { |
|
|
1048
|
+ $label = ( isset( $link_details[$length] ) ? $link_details[$length] : $link_details['label'] ); |
|
|
1049
|
+ if ( $length == 'icon' && isset( $link_details[$length] ) ) { |
|
1050
|
1050
|
$label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>'; |
|
1051
|
|
- $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
|
|
1051
|
+ $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
|
1052
|
1052
|
} |
|
1053
|
1053
|
|
|
1054
|
1054
|
$link .= '>' . $label . '</a>'; |
|
@@ -1204,7 +1204,7 @@ discard block |
|
|
block discarded – undo |
|
1204
|
1204
|
$status = 'publish'; |
|
1205
|
1205
|
} |
|
1206
|
1206
|
|
|
1207
|
|
- $name = $nice_names[ $status ]; |
|
|
1207
|
+ $name = $nice_names[$status]; |
|
1208
|
1208
|
|
|
1209
|
1209
|
return $name; |
|
1210
|
1210
|
} |
|
@@ -1231,11 +1231,11 @@ discard block |
|
|
block discarded – undo |
|
1231
|
1231
|
|
|
1232
|
1232
|
if ( count( $categories ) === 1 ) { |
|
1233
|
1233
|
$category = reset( $categories ); |
|
1234
|
|
- $icon = isset( $icons[ $category ] ) ? $icons[ $category ] : $icon; |
|
|
1234
|
+ $icon = isset( $icons[$category] ) ? $icons[$category] : $icon; |
|
1235
|
1235
|
} elseif ( ! empty( $categories ) ) { |
|
1236
|
1236
|
foreach ( $icons as $cat => $icon ) { |
|
1237
|
1237
|
if ( ! in_array( $cat, $categories ) ) { |
|
1238
|
|
- unset( $icons[ $cat ] ); |
|
|
1238
|
+ unset( $icons[$cat] ); |
|
1239
|
1239
|
} |
|
1240
|
1240
|
} |
|
1241
|
1241
|
$icon = reset( $icons ); |
|
@@ -1361,7 +1361,7 @@ discard block |
|
|
block discarded – undo |
|
1361
|
1361
|
|
|
1362
|
1362
|
foreach ( $item['categories'] as $k => $category ) { |
|
1363
|
1363
|
if ( in_array( $category, $plans ) ) { |
|
1364
|
|
- unset( $item['categories'][ $k ] ); |
|
|
1364
|
+ unset( $item['categories'][$k] ); |
|
1365
|
1365
|
if ( $category === 'Personal' ) { |
|
1366
|
1366
|
// Show the current package name. |
|
1367
|
1367
|
$category = 'Basic'; |