admin_form_before(); $output .= $this->admin_form_start(); $output .= $this->default_fields(); $widget_saved_values = $this->get_settings(); $output .= Text::get([ 'name' => 'button_title', 'label' => __('Button Title'), 'value' => $widget_saved_values['button_title'] ?? null, 'info' => __('enter button title'), ]); $output .= Text::get([ 'name' => 'button_link', 'label' => __('Button Link'), 'value' => $widget_saved_values['button_link'] ?? null, 'info' => __('enter button link'), ]); // add padding option $output .= $this->admin_form_submit_button(); $output .= $this->admin_form_end(); $output .= $this->admin_form_after(); return $output; } /** * @inheritDoc */ public function frontend_render() { $settings = $this->get_settings(); $button_title = SanitizeInput::esc_html($settings['button_title']); $button_link = SanitizeInput::esc_html($settings['button_link']); return <<
{$button_title}
HTML; } /** * @inheritDoc */ public function widget_title() { return __('Download Widgets: 01'); } }