I have this line
$logos = isset($instance['client_logo']) ? $instance['client_logo'] : [''];
causing this
Parse error: syntax error, unexpected '[' in .../widget-home-clients.php on line 18
How does it need to be changed?
I have this line
$logos = isset($instance['client_logo']) ? $instance['client_logo'] : [''];
causing this
Parse error: syntax error, unexpected '[' in .../widget-home-clients.php on line 18
How does it need to be changed?
If ['']
is intented to give you an array holding one empty string, you should do array('')
, because it appears your PHP version doesn't yet allow for this short syntax - it was introduced with PHP 5.4.
If you just wanted to get an empty string, just replace ['']
with ''
Use this:
$logos = (isset($instance['client_logo'])) ? $instance['client_logo'] : '';
Replace your code with the following code...
<?php
$logos = '';
if(isset($instance['client_logo']) && !empty($instance['client_logo']))
{
$logos= $instance['client_logo'];
}
?>