| @@ -216,9 +216,9 @@ | ||
| 216 | 216 | self::_renderSectionStart( esc_html__( 'Actions', 'visualizer' ), false ); |
| 217 | 217 | self::_renderCheckboxItem( |
| 218 | 218 | esc_html__( 'Print', 'visualizer' ), |
| 219 | 219 | 'actions[]', |
| 220 | - isset( $this->actions ) && in_array( 'print', $this->actions ) ? true : false, | |
| 220 | + isset( $this->actions ) && in_array( 'print', $this->actions, true ) ? true : false, | |
| 221 | 221 | 'print', |
| 222 | 222 | $disable_actions ? '<span class="viz-section-error">' . esc_html__( 'Upgrade to at least WordPress 4.7 to use this.', 'visualizer' ) . '</span>' : esc_html__( 'To enable printing the chart/data.', 'visualizer' ), |
| 223 | 223 | $disable_actions |
| 224 | 224 | ); |
| @@ -224,9 +224,9 @@ | ||
| 224 | 224 | ); |
| 225 | 225 | self::_renderCheckboxItem( |
| 226 | 226 | esc_html__( 'CSV', 'visualizer' ), |
| 227 | 227 | 'actions[]', |
| 228 | - isset( $this->actions ) && in_array( 'csv;application/csv', $this->actions ) ? true : false, | |
| 228 | + isset( $this->actions ) && in_array( 'csv;application/csv', $this->actions, true ) ? true : false, | |
| 229 | 229 | 'csv;application/csv', |
| 230 | 230 | $disable_actions ? '<span class="viz-section-error">' . esc_html__( 'Upgrade to at least WordPress 4.7 to use this.', 'visualizer' ) . '</span>' : esc_html__( 'To enable downloading the data as a CSV.', 'visualizer' ), |
| 231 | 231 | $disable_actions |
| 232 | 232 | ); |
| @@ -234,9 +234,9 @@ | ||
| 234 | 234 | $disabled = ! self::is_excel_enabled(); |
| 235 | 235 | self::_renderCheckboxItem( |
| 236 | 236 | esc_html__( 'Excel', 'visualizer' ), |
| 237 | 237 | 'actions[]', |
| 238 | - isset( $this->actions ) && in_array( 'xls;application/vnd.ms-excel', $this->actions ) ? true : false, | |
| 238 | + isset( $this->actions ) && in_array( 'xls;application/vnd.ms-excel', $this->actions, true ) ? true : false, | |
| 239 | 239 | 'xls;application/vnd.ms-excel', |
| 240 | 240 | $disable_actions ? '<span class="viz-section-error">' . esc_html__( 'Upgrade to at least WordPress 4.7 to use this.', 'visualizer' ) . '</span>' : ( $disabled ? '<span class="viz-section-error">' . esc_html__( 'Enable the ZIP and XML extensions to use this setting.', 'visualizer' ) . '</span>' : esc_html__( 'To enable downloading the data as an Excel spreadsheet.', 'visualizer' ) ), |
| 241 | 241 | $disable_actions || $disabled |
| 242 | 242 | ); |
| @@ -242,9 +242,9 @@ | ||
| 242 | 242 | ); |
| 243 | 243 | self::_renderCheckboxItem( |
| 244 | 244 | esc_html__( 'Copy', 'visualizer' ), |
| 245 | 245 | 'actions[]', |
| 246 | - isset( $this->actions ) && in_array( 'copy', $this->actions ) ? true : false, | |
| 246 | + isset( $this->actions ) && in_array( 'copy', $this->actions, true ) ? true : false, | |
| 247 | 247 | 'copy', |
| 248 | 248 | $disable_actions ? '<span class="viz-section-error">' . esc_html__( 'Upgrade to at least WordPress 4.7 to use this.', 'visualizer' ) . '</span>' : esc_html__( 'To enable copying the data to the clipboard.', 'visualizer' ), |
| 249 | 249 | $disable_actions |
| 250 | 250 | ); |
| @@ -564,9 +564,9 @@ | ||
| 564 | 564 | echo '<a class="more-info" href="javascript:;">[?]</a>'; |
| 565 | 565 | echo '<b>', $title, '</b>'; |
| 566 | 566 | echo '<select class="control-select ', implode( ' ', $classes ) , '" name="', $name, '" ', ( $multiple ? 'multiple' : '' ), ' ' , $atts, '>'; |
| 567 | 567 | foreach ( $options as $key => $label ) { |
| 568 | - $extra = $multiple && is_array( $value ) ? ( in_array( $key, $value ) ? 'selected' : '' ) : selected( $key, $value, false ); | |
| 568 | + $extra = $multiple && is_array( $value ) ? ( in_array( $key, $value, true ) ? 'selected' : '' ) : selected( $key, $value, false ); | |
| 569 | 569 | echo '<option value="', $key, '"', $extra, '>'; |
| 570 | 570 | echo $label; |
| 571 | 571 | echo '</option>'; |
| 572 | 572 | } |
| @@ -747,9 +747,9 @@ | ||
| 747 | 747 | protected static function _renderCheckboxItem( $title, $name, $value, $default, $desc, $disabled = false ) { |
| 748 | 748 | echo '<div class="viz-section-item">'; |
| 749 | 749 | echo '<a class="more-info" href="javascript:;">[?]</a>'; |
| 750 | 750 | echo '<b>', $title, '</b>'; |
| 751 | - echo '<input type="checkbox" class="control-check" value="', $default, '" name="', $name, '" ', ( $value == $default ? 'checked' : '' ), ' ', ( $disabled ? 'disabled=disabled' : '' ), '>'; | |
| 751 | + echo '<input type="checkbox" class="control-check" value="', $default, '" name="', $name, '" ', ( $value === $default ? 'checked' : '' ), ' ', ( $disabled ? 'disabled=disabled' : '' ), '>'; | |
| 752 | 752 | echo '<p class="viz-section-description">', $desc, '</p>'; |
| 753 | 753 | echo '</div>'; |
| 754 | 754 | } |
| 755 | 755 | |