public function get_element_attributes()
{
$attr_str = array();
foreach ($this->attributes as $attr => $val) {
if ($val === true) {
$attr_str[] = sanitize_key($attr);
} else {
$attr_str[] = sprintf('%s="%s"', sanitize_key($attr), esc_attr($val));
}
}
return implode(' ', $attr_str);
}