Skip to content

Commit

Permalink
Fix Unparenthesized a ? b : c ? d : e is deprecated. Use either `(a…
Browse files Browse the repository at this point in the history
… ? b : c) ? d : e` or `a ? b : (c ? d : e)` depreciation in Cuztom library
  • Loading branch information
nicomollet committed Aug 12, 2022
1 parent d92fb82 commit 579f48b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* **Tweak** - Images: alignment on images (picture tag)
* **Fix** - Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` depreciation

### 0.8.8: May 30th, 2022
* **Fix** - Update markdown-it and modernizr vulnerable versions
Expand Down
4 changes: 3 additions & 1 deletion inc/library/cuztom/classes/fields/checkboxes.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ function _output( $value )
{
foreach( $this->options as $slug => $name )
{
$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"' : '' ) ) . ' /> ';
$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"' : '' ) ) ) . ' /> ';
$output .= '<label ' . $this->output_for_attribute( $this->id . $this->after_id . '_' . Cuztom::uglify( $slug ) ) . '>' . Cuztom::beautify( $name ) . '</label>';
$output .= '<br />';
}
Expand Down
7 changes: 5 additions & 2 deletions inc/library/cuztom/classes/fields/multi_select.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@ function _output( $value )
{
$output = '<select ' . $this->output_name() . ' ' . $this->output_id() . ' ' . $this->output_css_class() . ' multiple="true">';
if( isset( $this->args['show_option_none'] ) )
$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>';
$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>';

if( is_array( $this->options ) )
{
foreach( $this->options as $slug => $name )
{
$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>';
$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>';
}
}
$output .= '</select>';
Expand Down
4 changes: 3 additions & 1 deletion inc/library/cuztom/classes/fields/post_checkboxes.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ function _output( $value )
{
foreach( $this->posts as $post )
{
$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"' : '' ) ) . ' /> ';
$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"' : '' ) ) ) . ' /> ';
$output .= '<label for="' . $this->id . $this->after_id . '_' . Cuztom::uglify( $post->post_title ) . '">' . $post->post_title . '</label>';
$output .= '<br />';
}
Expand Down
4 changes: 3 additions & 1 deletion inc/library/cuztom/classes/fields/term_checkboxes.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ function _output( $value )
{
foreach( $this->terms as $term )
{
$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"' : '' ) ) . ' /> ';
$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"' : '' ) ) ) . ' /> ';
$output .= '<label for="' . $this->id . $this->after_id . '_' . Cuztom::uglify( $term->name ) . '">' . $term->name . '</label>';
$output .= '<br />';
}
Expand Down

0 comments on commit 579f48b

Please sign in to comment.