Skip to content

Commit 579f48b

Browse files
committed
Fix Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) depreciation in Cuztom library
1 parent d92fb82 commit 579f48b

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
* **Tweak** - Images: alignment on images (picture tag)
2+
* **Fix** - Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` depreciation
23

34
### 0.8.8: May 30th, 2022
45
* **Fix** - Update markdown-it and modernizr vulnerable versions

inc/library/cuztom/classes/fields/checkboxes.class.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ function _output( $value )
2323
{
2424
foreach( $this->options as $slug => $name )
2525
{
26-
$output .= '<input type="checkbox" ' . $this->output_name() . ' ' . $this->output_id( $this->id . $this->after_id . '_' . Cuztom::uglify( $slug ) ) . ' ' . $this->output_css_class() . ' value="' . $slug . '" ' . ( is_array( $value ) ? ( in_array( $slug, $value ) ? 'checked="checked"' : '' ) : ( ( $value == '-1' ) ? '' : in_array( $slug, $this->default_value ) ? 'checked="checked"' : '' ) ) . ' /> ';
26+
$output .= '<input type="checkbox" ' . $this->output_name() . ' ' . $this->output_id( $this->id . $this->after_id . '_' . Cuztom::uglify( $slug ) ) . ' ' . $this->output_css_class() . ' value="' . $slug . '" ' . ( is_array( $value ) ? ( in_array( $slug, $value ) ? 'checked="checked"' : '' ) : ( ( $value
27+
== '-1' )
28+
? '' : ( in_array( $slug, $this->default_value ) ? 'checked="checked"' : '' ) ) ) . ' /> ';
2729
$output .= '<label ' . $this->output_for_attribute( $this->id . $this->after_id . '_' . Cuztom::uglify( $slug ) ) . '>' . Cuztom::beautify( $name ) . '</label>';
2830
$output .= '<br />';
2931
}

inc/library/cuztom/classes/fields/multi_select.class.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ function _output( $value )
2020
{
2121
$output = '<select ' . $this->output_name() . ' ' . $this->output_id() . ' ' . $this->output_css_class() . ' multiple="true">';
2222
if( isset( $this->args['show_option_none'] ) )
23-
$output .= '<option value="0" ' . ( is_array( $value ) ? ( in_array( 0, $value ) ? 'selected="selected"' : '' ) : ( ( $value == '-1' ) ? '' : in_array( 0, $this->default_value ) ? 'selected="selected"' : '' ) ) . '>' . $this->args['show_option_none'] . '</option>';
23+
$output .= '<option value="0" ' . ( is_array( $value ) ? ( in_array( 0, $value ) ? 'selected="selected"' : '' ) : ( ( $value == '-1' )
24+
? '' : ( in_array( 0, $this->default_value ) ? 'selected="selected"' : '' ) ) ) . '>' . $this->args['show_option_none'] . '</option>';
2425

2526
if( is_array( $this->options ) )
2627
{
2728
foreach( $this->options as $slug => $name )
2829
{
29-
$output .= '<option value="' . $slug . '" ' . ( is_array( $value ) ? ( in_array( $slug, $value ) ? 'selected="selected"' : '' ) : ( ( $value == '-1' ) ? '' : in_array( $slug, $this->default_value ) ? 'selected="selected"' : '' ) ) . '>' . Cuztom::beautify( $name ) . '</option>';
30+
$output .= '<option value="' . $slug . '" ' . ( is_array( $value ) ? ( in_array( $slug, $value ) ? 'selected="selected"' : '' ) : ( ( $value
31+
== '-1' )
32+
? '' : ( in_array( $slug, $this->default_value ) ? 'selected="selected"' : '' ) ) ) . '>' . Cuztom::beautify( $name ) . '</option>';
3033
}
3134
}
3235
$output .= '</select>';

inc/library/cuztom/classes/fields/post_checkboxes.class.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ function _output( $value )
3232
{
3333
foreach( $this->posts as $post )
3434
{
35-
$output .= '<input type="checkbox" ' . $this->output_name() . ' ' . $this->output_id( $this->id . $this->after_id . '_' . Cuztom::uglify( $post->post_title ) ) . ' ' . $this->output_css_class() . ' value="' . $post->ID . '" ' . ( is_array( $value ) ? ( in_array( $post->ID, $value ) ? 'checked="checked"' : '' ) : ( ( $value == '-1' ) ? '' : in_array( $post->ID, $this->default_value ) ? 'checked="checked"' : '' ) ) . ' /> ';
35+
$output .= '<input type="checkbox" ' . $this->output_name() . ' ' . $this->output_id( $this->id . $this->after_id . '_' . Cuztom::uglify( $post->post_title ) ) . ' ' . $this->output_css_class() . ' value="' . $post->ID . '" ' . ( is_array( $value ) ? ( in_array( $post->ID, $value ) ? 'checked="checked"' : '' ) : ( ( $value
36+
== '-1' )
37+
? '' : ( in_array( $post->ID, $this->default_value ) ? 'checked="checked"' : '' ) ) ) . ' /> ';
3638
$output .= '<label for="' . $this->id . $this->after_id . '_' . Cuztom::uglify( $post->post_title ) . '">' . $post->post_title . '</label>';
3739
$output .= '<br />';
3840
}

inc/library/cuztom/classes/fields/term_checkboxes.class.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ function _output( $value )
3434
{
3535
foreach( $this->terms as $term )
3636
{
37-
$output .= '<input type="checkbox" ' . $this->output_name() . ' ' . $this->output_id( $this->id . $this->after_id . '_' . Cuztom::uglify( $term->name ) ) . ' ' . $this->output_css_class() . ' value="' . $term->term_id . '" ' . ( is_array( $value ) ? ( in_array( $term->term_id, $value ) ? 'checked="checked"' : '' ) : ( ( $value == '-1' ) ? '' : in_array( $term->term_id, $this->default_value ) ? 'checked="checked"' : '' ) ) . ' /> ';
37+
$output .= '<input type="checkbox" ' . $this->output_name() . ' ' . $this->output_id( $this->id . $this->after_id . '_' . Cuztom::uglify( $term->name ) ) . ' ' . $this->output_css_class() . ' value="' . $term->term_id . '" ' . ( is_array( $value ) ? ( in_array( $term->term_id, $value ) ? 'checked="checked"' : '' ) : ( ( $value
38+
== '-1' )
39+
? '' : ( in_array( $term->term_id, $this->default_value ) ? 'checked="checked"' : '' ) ) ) . ' /> ';
3840
$output .= '<label for="' . $this->id . $this->after_id . '_' . Cuztom::uglify( $term->name ) . '">' . $term->name . '</label>';
3941
$output .= '<br />';
4042
}

0 commit comments

Comments
 (0)