Hi, I am getting a non-numeric value encountered warning on the line with the + in PHP 7.4. If I change the following from
and add an (int) to
The error goes away but shouldn’t I also be adding an (int) in front of $default_color too? Basing this on this link Warning: A non-numeric value encountered
PHP:
// Color picker
case "color":
$default_color = '';
if ( isset($value['std']) ) {
if ( $smof_data[$value['id']] != $value['std'] )
+ $default_color = ' data-default-color="' .$value['std'] . '" ';
}
$output .= '<input name="' . $value['id'] . '" id="' . $value['id'] . '" class="of-color" type="text" value="' . $smof_data[$value['id']] . '"' . $default_color .' />';
break;
and add an (int) to
PHP:
// Color picker
case "color":
$default_color = '';
if ( isset($value['std']) ) {
if ( (int)$smof_data[$value['id']] != $value['std'] )
+ $default_color = ' data-default-color="' .$value['std'] . '" ';
}
$output .= '<input name="' . $value['id'] . '" id="' . $value['id'] . '" class="of-color" type="text" value="' . $smof_data[$value['id']] . '"' . $default_color .' />';
break;
The error goes away but shouldn’t I also be adding an (int) in front of $default_color too? Basing this on this link Warning: A non-numeric value encountered