private function filter_attributes($attributes)
{
$out = array();
foreach ($attributes as $name => $value) {
switch ($name) {
case 'src':
case 'alt':
case 'class':
case 'srcset':
case 'sizes':
case 'on':
$out[$name] = $value;
break;
case 'width':
case 'height':
$out[$name] = $this->sanitize_dimension($value, $name);
break;
default:
break;
}
}
return $out;
}