function render()
{
$before_render = $this->before_render();
if (false === $before_render) {
return false;
}
$button = $button_start = $button_end = '';
if ($this->is_visible()) {
$link = trailingslashit(get_rtmedia_permalink($this->media->id)) . $this->action . '/';
$disabled = $icon = '';
if (!$this->is_clickable()) {
$disabled = ' disabled';
}
if (isset($this->icon_class) && '' !== $this->icon_class) {
$icon = "<i class='" . esc_attr($this->icon_class) . "'></i>";
}
$button_start = '<form action="' . esc_url($link) . '">';
$button = '<button type="submit" id="rtmedia-' . esc_attr($this->action) . '-button-' . esc_attr($this->media->id) . '" class="rtmedia-' . esc_attr($this->action) . ' rtmedia-action-buttons button' . esc_attr($disabled) . '">' . $icon . '<span>' . esc_html(apply_filters('rtmedia_' . $this->action . '_label_text', $this->label)) . '</span></button>';
//filter the button as required
$button = apply_filters('rtmedia_' . $this->action . '_button_filter', $button);
$button_end = '</form>';
$button = $button_start . $button . $button_end;
}
return $button;
}