{$title}
{$quote_text}
admin_form_before(); $output .= $this->admin_form_start(); $output .= $this->default_fields(); $widget_saved_values = $this->get_settings(); $output .= $this->admin_language_tab(); //have to start language tab from here on $output .= $this->admin_language_tab_start(); $all_languages = LanguageHelper::all_languages(); foreach ($all_languages as $key => $lang) { $output .= $this->admin_language_tab_content_start([ 'class' => $key == 0 ? 'tab-pane fade show active' : 'tab-pane fade', 'id' => "nav-home-" . $lang->slug ]); $output .= Text::get([ 'name' => 'title_'.$lang->slug, 'label' => __('Title'), 'value' => $widget_saved_values['title_' . $lang->slug] ?? null, ]); $output .= Summernote::get([ 'name' => 'description_'.$lang->slug, 'label' => __('Description'), 'value' => $widget_saved_values['description_' . $lang->slug] ?? null, ]); $output .= Textarea::get([ 'name' => 'quote_text_'.$lang->slug, 'label' => __('Quote Text'), 'value' => $widget_saved_values['quote_text_' . $lang->slug] ?? null, ]); $output .= $this->admin_language_tab_content_end(); } $output .= $this->admin_language_tab_end(); //have to end language tab $output .= Image::get([ 'name' => 'left_image', 'label' => __('Left Image'), 'value' => $widget_saved_values['left_image'] ?? null, 'dimensions' => '360x480px' ]); $output .= Image::get([ 'name' => 'left_image_two', 'label' => __('Left Image Two'), 'value' => $widget_saved_values['left_image_two'] ?? null, 'dimensions' => '360x480px' ]); $output .= Notice::get([ 'type' => 'secondary', 'text' => __('Section Settings'), ]); $output .= Slider::get([ 'name' => 'padding_top', 'label' => __('Padding Top'), 'value' => $widget_saved_values['padding_top'] ?? 120, 'max' => 500, ]); $output .= Slider::get([ 'name' => 'padding_bottom', 'label' => __('Padding Bottom'), 'value' => $widget_saved_values['padding_bottom'] ?? 120, 'max' => 500, ]); $output .= $this->admin_form_submit_button(); $output .= $this->admin_form_end(); $output .= $this->admin_form_after(); return $output; } /** * frontend_render * this method must have to implement by all widget to render frontend widget content * @since 1.0.0 * */ public function frontend_render(): string { $settings = $this->get_settings(); $current_lang = LanguageHelper::user_lang_slug(); $padding_top = SanitizeInput::esc_html($settings['padding_top']); $padding_bottom = SanitizeInput::esc_html($settings['padding_bottom']); $title = SanitizeInput::esc_html($settings['title_'.$current_lang]); $description = SanitizeInput::kses_basic($settings['description_'.$current_lang]); $quote_text = SanitizeInput::esc_html($settings['quote_text_'.$current_lang]); $left_image = render_image_markup_by_attachment_id($settings['left_image'],'','full'); $left_image_two = render_image_markup_by_attachment_id($settings['left_image_two'],'','full'); return <<
{$quote_text}