admin_form_before(); $output .= $this->admin_form_start(); $output .= $this->default_fields(); $widget_saved_values = $this->get_settings(); $output .= Text::get([ 'name' => 'location', 'label' => __('Location'), 'value' => $widget_saved_values['location'] ?? null, ]); $output .= Slider::get([ 'name' => 'map_height', 'label' => __('Map Height'), 'value' => $widget_saved_values['map_height'] ?? 500, 'max' => 2000, ]); $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 { $all_settings = $this->get_settings(); $map_height = SanitizeInput::esc_html($all_settings['map_height']); $location = SanitizeInput::esc_html($all_settings['location']); $location = sprintf( '
', rawurlencode($location), 10, $location ); return << {$location} HTML; } /** * widget_title * this method must have to implement by all widget to register widget title * @since 1.0.0 * */ public function addon_title() { return __('Google Map: 01'); } }