function thb_system_get_button($label, $url = '#', $atts = array()) { $atts = thb_array_asum(array('class' => '', 'id' => '', 'icon' => '', 'data' => array()), $atts); extract($atts); $btn = '<a href="' . $url . '" class="thb-btn ' . $class . '"'; if ($id != '') { $btn .= ' id="' . $id . '" '; } $btn .= thb_get_data_attributes($data); $btn .= '>'; if ($icon != '') { $btn .= '<img class="thb-btn-icon" src="' . THB_ADMIN_CSS_URL . '/i/' . $icon . '" />'; } $btn .= $label; $btn .= '</a>'; return $btn; }
function thb_data_attributes($atts = array()) { echo thb_get_data_attributes($atts, 'data-'); }