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' => 'subtitle_'.$lang->slug, 'label' => __('Subtitle'), 'value' => $widget_saved_values['subtitle_' . $lang->slug] ?? null, ]); $output .= Text::get([ 'name' => 'title_'.$lang->slug, 'label' => __('Title'), 'value' => $widget_saved_values['title_' . $lang->slug] ?? null, ]); $output .= Text::get([ 'name' => 'profession_'.$lang->slug, 'label' => __('Profession'), 'value' => $widget_saved_values['profession_' . $lang->slug] ?? null, ]); $output .= Textarea::get([ 'name' => 'description_'.$lang->slug, 'label' => __('Description'), 'value' => $widget_saved_values['description_' . $lang->slug] ?? null, ]); $output .= Text::get([ 'name' => 'button_text_'.$lang->slug, 'label' => __('Button Text'), 'value' => $widget_saved_values['button_text_' . $lang->slug] ?? null, ]); $output .= $this->admin_language_tab_content_end(); } $output .= $this->admin_language_tab_end(); //have to end language tab $output .= Text::get([ 'name' => 'button_url', 'label' => __('Button Url'), 'value' => $widget_saved_values['button_url'] ?? null, ]); $output .= IconPicker::get([ 'name' => 'button_icon', 'label' => __('Button Icon'), 'value' => $widget_saved_values['button_icon'] ?? 'fa far-star', ]); $output .= Image::get([ 'name' => 'right_side_image', 'label' => __('Right Image'), 'value' => $widget_saved_values['right_side_image'] ?? null, 'dimensions' => '770x1050' ]); $output .= Image::get([ 'name' => 'shape_side_image_01', 'label' => __('Shape Image 01'), 'value' => $widget_saved_values['shape_side_image_01'] ?? null, 'dimensions' => '120x120' ]); $output .= Image::get([ 'name' => 'shape_side_image_02', 'label' => __('Shape Image 02'), 'value' => $widget_saved_values['shape_side_image_02'] ?? null, 'dimensions' => '120x120' ]); $output .= Image::get([ 'name' => 'shape_side_image_03', 'label' => __('Shape Image 03'), 'value' => $widget_saved_values['shape_side_image_03'] ?? null, 'dimensions' => '120x120' ]); $output .= Image::get([ 'name' => 'shape_side_image_04', 'label' => __('Shape Image 04'), 'value' => $widget_saved_values['shape_side_image_04'] ?? null, 'dimensions' => '150x250' ]); $output .= Image::get([ 'name' => 'shape_side_image_05', 'label' => __('Shape Image 05'), 'value' => $widget_saved_values['shape_side_image_05'] ?? null, 'dimensions' => '150x250' ]); $output .= Slider::get([ 'name' => 'padding_top', 'label' => __('Padding Top'), 'value' => $widget_saved_values['padding_top'] ?? 250, 'max' => 500, ]); $output .= Slider::get([ 'name' => 'padding_bottom', 'label' => __('Padding Bottom'), 'value' => $widget_saved_values['padding_bottom'] ?? 300, 'max' => 500, ]); $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(); $current_lang = LanguageHelper::user_lang_slug(); $shape_01 = render_image_markup_by_attachment_id($settings['shape_side_image_01']); $shape_02 = render_image_markup_by_attachment_id($settings['shape_side_image_02']); $shape_03 = render_image_markup_by_attachment_id($settings['shape_side_image_03']); $shape_04 = render_image_markup_by_attachment_id($settings['shape_side_image_04']); $shape_05 = render_image_markup_by_attachment_id($settings['shape_side_image_05']); $right_image = render_image_markup_by_attachment_id($settings['right_side_image']); $subtitle = SanitizeInput::esc_html($settings['subtitle_'.$current_lang]); $profession = SanitizeInput::esc_html($settings['profession_'.$current_lang]); $title = SanitizeInput::esc_html($settings['title_'.$current_lang]); $description = SanitizeInput::esc_html($settings['description_'.$current_lang]); $button_text = SanitizeInput::esc_html($settings['button_text_'.$current_lang]); $button_icon = SanitizeInput::esc_html($settings['button_icon']); $button_url = SanitizeInput::esc_url($settings['button_url']); $padding_top = SanitizeInput::esc_html($settings['padding_top']); $padding_bottom = SanitizeInput::esc_html($settings['padding_bottom']); return <<