fewbricks\bricks\demo_button::get_button_html PHP Method

get_button_html() private method

private get_button_html ( $attributes, $text = false ) : string
$attributes
$text
return string
    private function get_button_html($attributes, $text = false)
    {
        if (isset($attributes['class'])) {
            $attributes['class'] = 'btn ' . $attributes['class'];
        } else {
            $attributes['class'] = 'btn';
        }
        if (!empty($this->css_class)) {
            $attributes['class'] .= ' ' . $this->css_class;
        }
        $html = '<a';
        $html .= ' href="' . $attributes['href'] . '"';
        $html .= ' class="' . $attributes['class'] . '"';
        $html .= $this->get_field('target_blank') ? ' target="_blank"' : '';
        $html .= '>';
        $html .= $text == false ? $this->get_field('text') : $text;
        $html .= '</a>';
        return $html;
    }